Skip to content

Commit

Permalink
Avoid long lines in TinyMCE init script
Browse files Browse the repository at this point in the history
  • Loading branch information
sdiemer committed Feb 6, 2024
1 parent e0c991b commit bd615c1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions vendors/tinymce/tinymce.custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ window.tinymceCustomGlobalOptions = {};
window.tinymceCustomInit = function (options) {
const onDOMReady = function () {
// Allowed elements must match the list from Django web utils (html_utils)
const ALLOWED_TAGS = ['div', 'p', 'span', 'br', 'b', 'strong', 'i', 'em', 'u', 'sub', 'sup', 'a', 'ul', 'ol', 'li', 'h1', 'h2', 'h3', 'h4', 'table', 'thead', 'tbody', 'tr', 'td', 'th', 'img', 'fieldset', 'legend', 'pre', 'code', 'blockquote', 'video', 'source'];
const ALLOWED_TAGS = [
'div', 'p', 'span', 'br', 'b', 'strong', 'i', 'em', 'u', 'sub', 'sup', 'a', 'ul', 'ol', 'li',
'h1', 'h2', 'h3', 'h4', 'table', 'thead', 'tbody', 'tr', 'td', 'th', 'img', 'fieldset', 'legend',
'pre', 'code', 'blockquote', 'video', 'source'
];
const ALLOWED_ATTRS = {
'*': ['class', 'style'],
'a': ['href', 'target', 'title'],
Expand All @@ -16,7 +20,11 @@ window.tinymceCustomInit = function (options) {
'source': ['src', 'type'],
'video': ['src', 'poster', 'loop', 'autoplay', 'muted', 'controls', 'playsinline', 'preload']
};
const ALLOWED_CSS = ['margin', 'padding', 'color', 'background', 'vertical-align', 'font-weight', 'font-size', 'font-style', 'text-decoration', 'text-align', 'text-shadow', 'border', 'border-radius', 'box-shadow', 'width', 'height', 'overflow'];
const ALLOWED_CSS = [
'margin', 'padding', 'color', 'background', 'vertical-align', 'font-weight',
'font-size', 'font-style', 'text-decoration', 'text-align', 'text-shadow',
'border', 'border-radius', 'box-shadow', 'width', 'height', 'overflow'
];

// Format valid elements for TinyMCE
const validElements = [];
Expand Down

0 comments on commit bd615c1

Please sign in to comment.