j
This commit is contained in:
34
backend/src/main/resources/html-sanitization-config.json
Normal file
34
backend/src/main/resources/html-sanitization-config.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"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",
|
||||
"ul", "ol", "li", "dl", "dt", "dd",
|
||||
"a", "table", "thead", "tbody", "tfoot", "tr", "th", "td", "caption",
|
||||
"blockquote", "cite", "q", "hr"
|
||||
],
|
||||
"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"],
|
||||
"td": ["class", "colspan", "rowspan"],
|
||||
"th": ["class", "colspan", "rowspan"]
|
||||
},
|
||||
"allowedCssProperties": [
|
||||
"color", "background-color", "font-size", "font-weight",
|
||||
"font-style", "text-align", "text-decoration", "margin",
|
||||
"padding", "text-indent", "line-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."
|
||||
}
|
||||
Reference in New Issue
Block a user