TryGhost / Ghost

Independent technology for modern publishing, memberships, subscriptions and newsletters.
https://ghost.org
MIT License
46.67k stars 10.17k forks source link

Pasting code into HTML cards doesn't properly work/save (in Firefox) #20562

Closed stromfeldt closed 1 month ago

stromfeldt commented 1 month ago

Issue Summary

Straight-up pasting code into an HTML card, saving, and then previewing, isn't working. And it isn't working because without a workaround the paste isn't being recognised (for lack of a better word/description).

If one pastes code into an HTML card, saves the document, then previews (without closing the HTML card), the material that was pasted into the HTML card is not displayed where it should be. Even though it's right there in the HTML card in the editor. Although it's actually not. Because if one then exits the HTML card and then re-enters it, one will see that the pasted material has somehow disappeared.

The workaround is to activate the keyboard after the paste (such as adding in a space and then deleting it), which seems to make the pasted material stick. Because upon previewing the post after the space + delete workaround one will see that the pasted material is in fact displayed.


I've just tried this out in Safari and Chrome, and this issue doesn't actually exist in those browsers. It does however persist in a private Firefox window, meaning no extensions, and so does appear to be a valid issue.

Sorry for the Firefox PITA :/

Steps to Reproduce

  1. Paste code into an HTML card
  2. Save
  3. Preview
  4. The pasted code isn't visible

  1. Paste code into an HTML card
  2. Hit the space bar after the paste and then delete the added space
  3. Save
  4. Preview
  5. The pasted code is visible

Ghost Version

5.87.0+moya

Node.js Version

Yes

How did you install Ghost?

Ghost(Pro)

Database type

MySQL 5.7

Browser & OS version

Firefox 127.0.2 on macOS 14.5

Relevant log / error output

No response

Code of Conduct

Faizan711 commented 1 month ago

Hey, I saw what you guys are building at ghost and wanted to ask that are you assigning these issues to others, like can I contribute here? I really like what your team is building and would love to contribute to this project.

stromfeldt commented 1 month ago

This has (fortunately) somehow resolved itself. I'm not sure if it's a Firefox thing (having been updated from 127.0.2 to 128.0.2) or a Ghost thing (having been updated from 5.87.0+moya to 5.88.1+moya), but either way the issue no longer persists.