mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-17 18:21:28 +10:00
Fix broken images
- Allowed img tags to be used in summaries
This commit is contained in:
@ -60,6 +60,19 @@ export const parseLayoutLocator = (payload: SortablePayload | null): LayoutLocat
|
|||||||
export const sanitize = (html: string, options?: sanitizeHtml.IOptions) => {
|
export const sanitize = (html: string, options?: sanitizeHtml.IOptions) => {
|
||||||
return sanitizeHtml(html, {
|
return sanitizeHtml(html, {
|
||||||
...options,
|
...options,
|
||||||
|
allowedTags: [
|
||||||
|
...options?.allowedTags,
|
||||||
|
// default tags (https://www.npmjs.com/package/sanitize-html#default-options)
|
||||||
|
"address", "article", "aside", "footer", "header", "h1", "h2", "h3", "h4",
|
||||||
|
"h5", "h6", "hgroup", "main", "nav", "section", "blockquote", "dd", "div",
|
||||||
|
"dl", "dt", "figcaption", "figure", "hr", "li", "main", "ol", "p", "pre",
|
||||||
|
"ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn",
|
||||||
|
"em", "i", "kbd", "mark", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp",
|
||||||
|
"small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "caption",
|
||||||
|
"col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr",
|
||||||
|
// images
|
||||||
|
"img",
|
||||||
|
],
|
||||||
allowedAttributes: {
|
allowedAttributes: {
|
||||||
...options?.allowedAttributes,
|
...options?.allowedAttributes,
|
||||||
"*": ["class", "style"],
|
"*": ["class", "style"],
|
||||||
|
|||||||
Reference in New Issue
Block a user