Jul 24 - Update Rich-text editor to enhance table editor 3

This commit is contained in:
2026-07-24 11:21:03 -04:00
parent 931cfc0f64
commit 2e65745aed
3 changed files with 20 additions and 2 deletions
+5
View File
@@ -127,6 +127,11 @@ shows only `is_published` topics (sections with no published topics are hidden).
custom wiring. Init is guarded by `typeof QuillTableBetter` so a failed vendor
load still leaves a working editor + textarea. Registration and keyboard bindings
(`QuillTableBetter.keyboardBindings`) live in `topic_form.html`.
- **Save/load round-trip (critical):** save with `deleteTableTemporary()` then
`quill.getSemanticHTML()`. **Load must NOT use `dangerouslyPasteHTML`/`setContents`**
— quill-table-better renders tables *blank* that way. Instead convert then apply:
`quill.updateContents(quill.clipboard.convert({html}), 'user')`. The non-table
fallback path still uses `dangerouslyPasteHTML`.
- **Sanitize on save:** `sanitize_html()` (bleach) runs on every `body_html`
write — `ALLOWED_TAGS`/`ALLOWED_ATTRS` cover `img` + full table tags with
`colspan/rowspan/data-*/style`; a `CSSSanitizer` (bleach[css] + `tinycss2`)