mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-17 18:21:28 +10:00
fixes #2176, text align was not being reflected in summary sections
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import sanitizeHtml from "sanitize-html";
|
||||
import type { Config as UniqueNamesConfig } from "unique-names-generator";
|
||||
import { adjectives, animals, uniqueNamesGenerator } from "unique-names-generator";
|
||||
|
||||
@ -55,3 +56,17 @@ export const parseLayoutLocator = (payload: SortablePayload | null): LayoutLocat
|
||||
|
||||
return { page, column, section };
|
||||
};
|
||||
|
||||
export const sanitize = (html: string, options?: sanitizeHtml.IOptions) => {
|
||||
return sanitizeHtml(html, {
|
||||
...options,
|
||||
allowedAttributes: {
|
||||
...options?.allowedAttributes,
|
||||
"*": ["class", "style"],
|
||||
},
|
||||
allowedStyles: {
|
||||
...options?.allowedStyles,
|
||||
"*": { "text-align": [/^left$/, /^right$/, /^center$/, /^justify$/] },
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user