Jul 24 - Update Rich-text editor to enhance table editor 4
This commit is contained in:
@@ -30,7 +30,9 @@
|
||||
"Bash(python -m py_compile app.py admin.py)",
|
||||
"Bash(cd /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\")"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,6 +106,8 @@ _TABLE_CELL_ATTRS = [
|
||||
ALLOWED_ATTRS = {
|
||||
"a": ["href", "title", "target", "rel"],
|
||||
"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"],
|
||||
"colgroup": ["style"],
|
||||
"col": ["width", "span", "style"],
|
||||
|
||||
@@ -149,6 +149,11 @@
|
||||
var toolbarEl = document.getElementById('editor-toolbar');
|
||||
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,
|
||||
// borders and background. Registered only if the vendor script loaded.
|
||||
var hasTables = typeof QuillTableBetter !== 'undefined';
|
||||
|
||||
Reference in New Issue
Block a user