mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-12 07:43:10 +10:00
fixes #2176, text align was not being reflected in summary sections
This commit is contained in:
@ -9,12 +9,13 @@
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"papaparse": "^5.4.1",
|
||||
"dayjs": "^1.11.11",
|
||||
"unique-names-generator": "^4.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"tailwind-merge": "^2.3.0",
|
||||
"@swc/helpers": "~0.5.11",
|
||||
"clsx": "^2.1.1",
|
||||
"dayjs": "^1.11.11",
|
||||
"papaparse": "^5.4.1",
|
||||
"sanitize-html": "^2.14.0",
|
||||
"tailwind-merge": "^2.3.0",
|
||||
"unique-names-generator": "^4.7.1",
|
||||
"zod": "^3.24.1"
|
||||
}
|
||||
}
|
||||
|
||||
@ -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