mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-07-19 01:24:19 +00:00
* fix: bold text retains formatting after copy-paste When pasting bold (or italic, underline, etc.) text, the browser's contentEditable engine normalized the pasted DOM before Etherpad's content collector could extract the formatting. The pasted HTML contained proper <b> tags, but the browser flattened the nested ace-line divs and stripped the inline formatting in the process. Now the paste handler checks clipboard HTML for formatting tags. If found, it prevents default browser paste, parses the HTML in a detached DOMParser document, and inserts the nodes directly into the editor. This preserves the formatting tags for the content collector. Fixes #5037 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * security: sanitize pasted HTML to prevent XSS via clipboard Strip dangerous elements (script, style, iframe, object, embed, form, link, meta) and event handler attributes (onclick, onerror, etc.) from pasted HTML before inserting into the editor. Also removes javascript: URLs from href attributes. DOMParser doesn't execute scripts, but importNode copies all attributes including event handlers that execute when inserted into the live document. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| backend | ||
| backend-new | ||
| container | ||
| frontend | ||
| frontend-new | ||
| ratelimit | ||
| README.md | ||
| settings.json | ||
About this folder: Tests
Before running the tests, start an Etherpad instance on your machine.
Frontend
To run the frontend tests, point your browser to <yourdomainhere>/tests/frontend
Backend
To run the backend tests, run cd src and then npm test