Skip to content

Avoid copying diffs as Markdown tables

Stan Hu requested to merge sh-fix-paste-markdown-from-diff into master

Under certain circumstances with Chrome, copying a diff and pasting it in a Markdown block could format the code in a Markdown table instead of preserving the existing format. It appears that Chrome copies each diff row as a single table, while browsers such as Firefox create separate tables for rows. The table detector could be fooled if the right number of columns and rows appeared in the paste buffer.

To fix this issue, we disable the auto-table formatting if the table originated from a diff.

Closes #213033 (closed)

Edited by Stan Hu

Merge request reports