refactor(server): deduplicate options init

This commit is contained in:
Elian Doran
2025-03-10 21:21:59 +02:00
parent e79f18f001
commit d639798fa8

View File

@@ -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
},