testmycode/tmc-server

tmc-paste: newlines inserted between each line of code copied from firefox

Closed this issue · 1 comments

Copying from a tmc-paste code listing in Firefox inserts an extra newline between each line of code when pasted into a text editor.

Copying works as expected in the Chromium browser.

The problem disappears when highlightjs-line-numbers is prevented from loading. If line numbering is unimportant this may be the better solution.

The issue appears to be caused independently by to two issues with Firefox, at least one of which is a bug:

  • Firefox inserts a line break before div block elements.
    • Can be fixed by setting CSS display: block-inline on the relevant divs
  • Firefox inserts newlines when selecting elements with CSS property user-select: none

Thank you for bringing this problem to our attention, and thank you for the pull request #547 to fix this!

The pull request has now been merged, so I'll close this issue.