Jul 24 - Update Rich-text editor to enhance table editor 3
This commit is contained in:
@@ -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`)
|
||||
|
||||
Reference in New Issue
Block a user