romannurik / SlidesCodeHighlighter

A little web app that helps you copy+paste syntax-highlighted code into slide decks.
https://romannurik.github.io/SlidesCodeHighlighter/
Apache License 2.0
1.06k stars 92 forks source link

Font colour is not preserved on Firefox+GNU/Linux #55

Open Wheest opened 3 years ago

Wheest commented 3 years ago

Copying highlighted text on Firefox on Linux loses all font colour information.

Does not occur on Chromium.

Firefox version 68.11.0esr.

romannurik commented 3 years ago

Hi there! A few things:

  1. I can't easily test this, nor can I really guarantee support for various platforms/browsers/etc due to how clipboards work.
  2. Where are you pasting into? Google Slides? Something else?
pil0u commented 3 years ago

Hey Roman, thanks for the great tool! Same here, pasting into Google Slides and just like Wheest, Chromium works just fine on Linux.

When pasting from Firefox, the whole formatting is kept, except for the color. I had no luck after some research online, I have no idea why this happens.

Wheest commented 3 years ago

The issue still occurs for me. To clarify, pasting into Google Slides on Firefox from Chromium preserves the formatting, however copying from the webapp on Firefox loses the colour information.

benjaminp commented 1 year ago

Chromium-based browsers automatically inline out-of-line style information on HTML elements copied into the clipboard, but Firefox does not. Presumably, either fixing https://bugzilla.mozilla.org/show_bug.cgi?id=406488 or changing the code highlighter to use inline CSS rather than classes would resolve this issue.