mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: fix language-* class
This commit is contained in:
1 file changed
+1
-1
@@ -151,7 +151,7 @@ export const xss = new FilterXSS({
|
||||
css: cssFilterOptions,
|
||||
safeAttrValue(tag, name, value) {
|
||||
if (name === 'id') return escapeAttrValue(`xss-id-${value}`);
|
||||
if (name === 'class') return value.split(' ').filter((i) => whitelistClasses.includes(i)).join(' ');
|
||||
if (name === 'class') return value.split(' ').filter((i) => whitelistClasses.includes(i) || i.startsWith('language-')).join(' ');
|
||||
return safeAttrValue(tag, name, value, CssFilter);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user