Skip to content

Fix Markdown table paste not working with GitHub code

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

In Chrome, copying a block of code GitHub includes an HTML table with both the line number and the line itself. This caused the paste function to be fooled that a table should be inserted as Markdown instead of plain text.

Now, we increase the requirements for pasting a table by comparing the HTML and text data:

  1. The number of rows have to match
  2. The max number of columns have to match

Note that we use the max number of columns in the tab-delimited text because it's possible that a spreadsheet omits empty columns.

Closes #195479 (closed)

Edited by Stan Hu

Merge request reports