codejar icon indicating copy to clipboard operation
codejar copied to clipboard

Copy-paste does not preserve formatting (Firefox MacOS)

Open eyssette opened this issue 9 months ago • 5 comments

Hello,

Thank you again for this great application!

I've noticed what seems to be a new bug: on Firefox (apparently only on Mac), copy-pasting does not preserve formatting.

To reproduce: on this page, if you copy the text from an example and paste it back in the same place, the formatting is lost.

https://medv.io/codejar/

eyssette avatar Mar 10 '25 08:03 eyssette

It's probably related to this:

https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/136 The plaintext-only value of the contenteditable global attribute indicates that the element is editable; rich text formatting is disabled and any formatting in pasted text is automatically stripped (Firefox bug 1922724).

eyssette avatar Mar 10 '25 08:03 eyssette

Yea) I'm not interested in fixing FF bugs (as it is too many to), but will be happy to merge a PR with a fix.

antonmedv avatar Mar 10 '25 09:03 antonmedv

Seems to work : https://github.com/antonmedv/codejar/pull/126

eyssette avatar Mar 10 '25 10:03 eyssette

@eyssette Would you mind verifying whether my changes in #118 resolve this? I don’t have Firefox 136 to test it, unfortunately, but I fixed some issues related to Firefox.

zamfofex avatar Mar 10 '25 22:03 zamfofex

I tested it. Your improvements helped, but after pressing Enter, the cursor was still on the old line, but then continued writing on the new one. The fix was therefore necessary after all.

wi-wissen avatar Oct 09 '25 14:10 wi-wissen