From 9ef899eec592e2469a1d40b8e0c0e8b66764750a Mon Sep 17 00:00:00 2001 From: maphew Date: Sun, 17 Nov 2024 15:58:48 -0700 Subject: [PATCH] extend html tags which are kept on import https://github.com/TriliumNext/Notes/issues/567 this is the easy method, just add the tags to core, not attempting to read the list from a user configurable location. The addition is clearly marked in code. --- src/services/html_sanitizer.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/services/html_sanitizer.ts b/src/services/html_sanitizer.ts index ec76883b8..9a66c6ede 100644 --- a/src/services/html_sanitizer.ts +++ b/src/services/html_sanitizer.ts @@ -32,7 +32,11 @@ function sanitize(dirtyHtml: string) { 'figure', 'figcaption', 'span', 'label', 'input', 'details', 'summary', 'address', 'aside', 'footer', 'header', 'hgroup', 'main', 'nav', 'dl', 'dt', 'menu', 'bdi', 'bdo', 'dfn', 'kbd', 'mark', 'q', 'time', 'var', 'wbr', 'area', 'map', 'track', 'video', 'audio', 'picture', 'del', 'ins', - 'en-media' // for ENEX import + 'en-media', // for ENEX import + // Additional tags (https://github.com/TriliumNext/Notes/issues/567) + 'acronym', 'article', 'big', 'button', 'cite', 'col', 'colgroup', 'data', 'dd', + 'fieldset', 'form', 'legend', 'meter', 'noscript', 'option', 'progress', 'rp', + 'samp', 'small', 'sub', 'sup', 'template', 'textarea', 'tt' ], allowedAttributes: { '*': [ 'class', 'style', 'title', 'src', 'href', 'hash', 'disabled', 'align', 'alt', 'center', 'data-*' ]