mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 18:33:33 +00:00
fix all imports for new structure
This commit is contained in:
parent
249eaf89f8
commit
930165d006
291 changed files with 2056 additions and 1894 deletions
|
|
@ -11,7 +11,7 @@ const regex = /(url\("?)(?!data:)/gim;
|
|||
|
||||
const addStyles = (output: string[], styles: CSSStyleDeclaration) => {
|
||||
for (let prop = styles.length - 1; prop >= 0; prop -= 1) {
|
||||
const key = styles[prop] as keyof CSSStyleDeclaration;
|
||||
const key = styles[prop] as string;
|
||||
if (key !== 'content' && styles[key]) {
|
||||
const value = styles[key];
|
||||
const priority = styles.getPropertyPriority(key as string);
|
||||
|
|
@ -75,7 +75,7 @@ DomPurify.addHook('afterSanitizeAttributes', (node: Element) => {
|
|||
}
|
||||
});
|
||||
|
||||
DomPurify.addHook('uponSanitizeElement', (node: Element) => {
|
||||
(DomPurify as any).addHook('uponSanitizeElement', (node: Element) => {
|
||||
if (node.tagName === 'STYLE') {
|
||||
const rules = (node as HTMLStyleElement).sheet?.cssRules;
|
||||
if (rules) {
|
||||
|
|
@ -91,7 +91,7 @@ export const sanitize = (text: string): string => {
|
|||
};
|
||||
|
||||
export const sanitizeCss = (text: string): string => {
|
||||
return DomPurify.sanitize(text, {
|
||||
return (DomPurify as any).sanitize(text, {
|
||||
ALLOWED_ATTR: [],
|
||||
ALLOWED_TAGS: ['style'],
|
||||
RETURN_DOM: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue