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

This commit is contained in:
2026-07-24 11:32:03 -04:00
parent 2e65745aed
commit c4ad6e8ac9
3 changed files with 10 additions and 1 deletions
+3 -1
View File
@@ -30,7 +30,9 @@
"Bash(python -m py_compile app.py admin.py)", "Bash(python -m py_compile app.py admin.py)",
"Bash(cd /tmp *)", "Bash(cd /tmp *)",
"Read(//tmp/**)", "Read(//tmp/**)",
"Bash(curl -sSL https://raw.githubusercontent.com/attoae/quill-table-better/main/src/utils/clipboard-matchers.ts -o cm.ts -w \"cm %{http_code}\\\\n\")" "Bash(curl -sSL https://raw.githubusercontent.com/attoae/quill-table-better/main/src/utils/clipboard-matchers.ts -o cm.ts -w \"cm %{http_code}\\\\n\")",
"Bash(curl -sSL https://raw.githubusercontent.com/attoae/quill-table-better/main/src/ui/table-menus.ts -o tm.ts -w \"tm %{http_code}\\\\n\")",
"Bash(curl -sSL https://raw.githubusercontent.com/attoae/quill-table-better/main/src/ui/table-properties-form.ts -o tpf.ts -w \"tpf %{http_code}\\\\n\")"
] ]
} }
} }
+2
View File
@@ -106,6 +106,8 @@ _TABLE_CELL_ATTRS = [
ALLOWED_ATTRS = { ALLOWED_ATTRS = {
"a": ["href", "title", "target", "rel"], "a": ["href", "title", "target", "rel"],
"img": ["src", "alt", "width", "height"], "img": ["src", "alt", "width", "height"],
# cell alignment lives as inline `text-align` on the cell's <p> block
"p": ["style"],
"table": ["class", "style", "align", "width", "height", "data-class"], "table": ["class", "style", "align", "width", "height", "data-class"],
"colgroup": ["style"], "colgroup": ["style"],
"col": ["width", "span", "style"], "col": ["width", "span", "style"],
+5
View File
@@ -149,6 +149,11 @@
var toolbarEl = document.getElementById('editor-toolbar'); var toolbarEl = document.getElementById('editor-toolbar');
var editorEl = document.getElementById('editor'); var editorEl = document.getElementById('editor');
// Persist alignment as inline `text-align` (style) rather than a Quill CSS
// class, so cell alignment survives the HTML sanitizer and renders on the
// public page with no extra CSS. Must run before the editor is created.
Quill.register(Quill.import('attributors/style/align'), true);
// quill-table-better: resizable columns/rows + a cell menu for alignment, // quill-table-better: resizable columns/rows + a cell menu for alignment,
// borders and background. Registered only if the vendor script loaded. // borders and background. Registered only if the vendor script loaded.
var hasTables = typeof QuillTableBetter !== 'undefined'; var hasTables = typeof QuillTableBetter !== 'undefined';