ui: fix check for void tags

pull/311/head
undefined 3 years ago
parent 562df8df6e
commit 66c5c6b560

@ -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",

Loading…
Cancel
Save