Repository navigation
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
There was a problem hiding this comment.
🟡 Changes recommended
A critical active-content injection issue remains in src/utils/methods.js because unsanitized href and src URLs can preserve javascript: payloads that execute when the cleaned HTML is rendered.
1 open issue
What changed in this PR
This PR adds shared paste-cleaning behavior for CFP rich-text editors, preserving useful formatting from Google Docs and delegating Word cleanup to Jodit while removing excess markup. It also adds a 1,500-character validation message for event category descriptions.
Changes:
- Added HTML cleanup utilities and shared Jodit paste options.
- Applied paste cleaning to category, category-group, submission disclaimer, and CFP message editors.
- Added the category description length constant, validation message, and utility tests.
| File | Description |
|---|---|
| src/utils/methods.js | Implements Google Docs HTML cleanup and shared Jodit paste options. |
| src/utils/constants.js | Defines the category description length limit and bold-font threshold constants. |
| src/utils/__tests__/methods.test.js | Tests list cleanup, formatting conversion, and link preservation. |
| src/i18n/en.json | Adds the category description HTML length validation message. |
| src/components/forms/selection-plan-form/main-tab.js | Enables paste cleaning for the submission disclaimer editor. |
| src/components/forms/selection-plan-form/cfp-settings-tab.js | Enables paste cleaning for the CFP settings message editor. |
| src/components/forms/event-category-group-form.js | Enables paste cleaning for category-group descriptions. |
| src/components/forms/event-category-form.js | Enables paste cleaning and 1,500-character validation for category descriptions. |
Review effort: Lite
da450c8 to
5d9811a
Compare
| }); | ||
| doc.body.querySelectorAll("li > p:only-child").forEach(unwrap); | ||
| doc.body.querySelectorAll("p").forEach((p) => { | ||
| if (!p.textContent.trim() && !p.querySelector("img, br")) p.remove(); |
There was a problem hiding this comment.
This drops the blank lines from Word pastes. Word sends an empty line as <p class=MsoNormal><o:p> </o:p></p>, and .trim() strips the , so the paragraph gets removed and the spacing the author added between blocks is lost. Only the Google Docs form (<p><br></p>) survives, which is the only case the "keeps blank lines" test covers. Checking for before trimming (or turning those paragraphs into <p><br></p>) would keep them; a test with a Word blank line would cover it.
There was a problem hiding this comment.
Ok, made this change. I also noticed that word bullets/numbered lists get replaced by a fake bullet. I will look at this in a follow up since usually Mark pastes from google docs.

ref: https://app.clickup.com/t/9014802374/1k5eh57927p
Up next (follow-up PRs)