Merge dev, add translation

This commit is contained in:
_Bastler
2022-01-26 12:32:10 +01:00
30 changed files with 411 additions and 324 deletions
+14 -11
View File
@@ -33,18 +33,21 @@ export class HtmlUtils {
return p.innerHTML;
}
public static sanitize(html : string) {
return sanitizeHtml(html, {
allowedAttributes: {
'span': ['style'],
},
allowedStyles: {
'span': {
'color': [/^#(0x)?[0-9a-f]+$/i, /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/],
'font-size': [/^\d+(?:px|em|%)$/]
public static sanitize(html : string | number | boolean | undefined): string {
if (typeof html === "string") {
return sanitizeHtml(html, {
allowedAttributes: {
'span': ['style'],
},
allowedStyles: {
'span': {
'color': [/^#(0x)?[0-9a-f]+$/i, /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/],
'font-size': [/^\d+(?:px|em|%)$/]
}
}
}
});
});
}
return "";
}
public static urlify(text: string, style: string = ""): string {