• Stan Hu's avatar
    Avoid copying diffs as Markdown tables · a5a3ed15
    Stan Hu authored
    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 https://gitlab.com/gitlab-org/gitlab/-/issues/213033
    a5a3ed15
paste_markdown_table_spec.js 3.8 KB