Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
refactor(server): deduplicate options init
Elian Dorand639798fa818
diff --git a/src/services/options_init.ts b/src/services/options_init.tsindex 979459eec8..a3bb95c767 100644--- a/src/services/options_init.ts+++ b/src/services/options_init.ts@@ -6,6 +6,7 @@ import log from "./log.js";import dateUtils from "./date_utils.js";import keyboardActions from "./keyboard_actions.js";import type { KeyboardShortcutWithRequiredActionName } from "./keyboard_actions_interface.js";+import { DEFAULT_ALLOWED_TAGS } from "./html_sanitizer.js";function initDocumentOptions() {optionService.createOption("documentId", randomSecureToken(16), false);@@ -159,102 +160,7 @@ const defaultOptions: DefaultOption[] = [{ name: "backgroundEffects", value: "false", isSynced: false },{name: "allowedHtmlTags",- value: JSON.stringify([- "h1",- "h2",- "h3",- "h4",- "h5",- "h6",- "blockquote",- "p",- "a",- "ul",- "ol",- "li",- "b",- "i",- "strong",- "em",- "strike",- "s",- "del",- "abbr",- "code",- "hr",- "br",- "div",- "table",- "thead",- "caption",- "tbody",- "tfoot",- "tr",- "th",- "td",- "pre",- "section",- "img",- "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",- "acronym",- "article",- "big",- "button",- "cite",- "col",- "colgroup",- "data",- "dd",- "fieldset",- "form",- "legend",- "meter",- "noscript",- "option",- "progress",- "rp",- "samp",- "small",- "sub",- "sup",- "template",- "textarea",- "tt"- ]),+ value: JSON.stringify(DEFAULT_ALLOWED_TAGS),isSynced: true},