datasquirel/package-shared/functions/backend/html/sanitizeHtmlOptions.ts
2026-02-21 06:54:01 +01:00

44 lines
820 B
TypeScript

const sanitizeHtmlOptions = {
allowedTags: [
"b",
"i",
"em",
"strong",
"a",
"p",
"span",
"ul",
"ol",
"li",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"img",
"div",
"button",
"pre",
"code",
"br",
"table",
"tr",
"td",
"th",
"thead",
"tbody",
"tfoot",
"caption",
"colgroup",
"col",
],
allowedAttributes: {
a: ["href", "title", "class", "style", "target"],
img: ["src", "alt", "width", "height", "class", "style"],
"*": ["style", "class", "title"],
},
};
export default sanitizeHtmlOptions;