Files
storycove/backend/src/main/resources/html-sanitization-config.json
2025-07-24 13:15:31 +02:00

79 lines
3.0 KiB
JSON

{
"allowedTags": [
"p", "br", "div", "span", "h1", "h2", "h3", "h4", "h5", "h6",
"b", "strong", "i", "em", "u", "s", "strike", "del", "ins",
"sup", "sub", "small", "big", "mark", "pre", "code", "kbd", "samp", "var",
"ul", "ol", "li", "dl", "dt", "dd",
"a", "table", "thead", "tbody", "tfoot", "tr", "th", "td", "caption", "colgroup", "col",
"blockquote", "cite", "q", "hr", "details", "summary",
"section", "article", "font", "center", "abbr", "dfn", "tt"
],
"allowedAttributes": {
"p": ["class", "style"],
"div": ["class", "style"],
"span": ["class", "style"],
"h1": ["class", "style"],
"h2": ["class", "style"],
"h3": ["class", "style"],
"h4": ["class", "style"],
"h5": ["class", "style"],
"h6": ["class", "style"],
"a": ["class"],
"table": ["class", "style"],
"th": ["class", "style", "colspan", "rowspan"],
"td": ["class", "style", "colspan", "rowspan"],
"tr": ["class", "style"],
"thead": ["class", "style"],
"tbody": ["class", "style"],
"tfoot": ["class", "style"],
"ul": ["class", "style"],
"ol": ["class", "style", "start", "type"],
"li": ["class", "style"],
"blockquote": ["class", "style"],
"pre": ["class", "style"],
"code": ["class", "style"],
"details": ["class", "style"],
"summary": ["class", "style"],
"section": ["class", "style"],
"article": ["class", "style"],
"font": ["class", "style", "color", "size", "face"],
"center": ["class", "style"],
"abbr": ["class", "style", "title"],
"dfn": ["class", "style"],
"tt": ["class", "style"],
"b": ["class", "style"],
"strong": ["class", "style"],
"i": ["class", "style"],
"em": ["class", "style"],
"u": ["class", "style"],
"s": ["class", "style"],
"small": ["class", "style"],
"big": ["class", "style"],
"mark": ["class", "style"],
"sup": ["class", "style"],
"sub": ["class", "style"],
"del": ["class", "style"],
"ins": ["class", "style"],
"strike": ["class", "style"],
"kbd": ["class", "style"],
"samp": ["class", "style"],
"var": ["class", "style"]
},
"allowedCssProperties": [
"color", "background-color", "font-size", "font-weight",
"font-style", "text-align", "text-decoration", "margin",
"padding", "text-indent", "line-height",
"border", "border-color", "border-width", "border-style",
"font-family", "font-variant", "font-variant-ligatures",
"font-variant-caps", "font-variant-numeric", "font-variant-east-asian",
"font-variant-alternates", "font-variant-position", "font-variant-emoji",
"font-stretch", "letter-spacing", "word-spacing",
"text-transform", "text-shadow", "white-space",
"vertical-align", "display", "float", "clear",
"width", "height", "min-width", "min-height", "max-width", "max-height"
],
"removedAttributes": {
"a": ["href", "target"]
},
"description": "HTML sanitization configuration for StoryCove story content. This configuration is shared between frontend (DOMPurify) and backend (Jsoup) to ensure consistency."
}