mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
ui: fix check for void tags
This commit is contained in:
1 parent
562df8df6e
commit
66c5c6b560
2 files changed
+3
-2
No files matched your search
@@ -1,12 +1,13 @@
|
||||
import * as Xss from 'xss';
|
||||
|
||||
const stack = [];
|
||||
const voidTags = ['br', 'hr', 'input', 'img', 'link', 'source', 'col', 'area', 'base', 'meta', 'embed', 'param', 'track', 'wbr'];
|
||||
|
||||
const tagCheck = new Xss.FilterXSS({
|
||||
css: false,
|
||||
whiteList: {},
|
||||
onIgnoreTag(tag, html, options) {
|
||||
if (html.endsWith('/>')) return html;
|
||||
if (html.endsWith('/>') || voidTags.includes(tag)) return html;
|
||||
if (!options.isClosing) {
|
||||
stack.push(tag);
|
||||
return html;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.31.12",
|
||||
"version": "4.31.13",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "hydro.js",
|
||||
|
||||
Reference in new issue
Block a user