parser: sanitize HTML: allow 'disabled', 'start', 'type' and 'checked' attributes

This makes check box lists like the following snipped work:

- [X] Done
- [ ] not done

Further allow the start attr, sometimes generated for ordered lists.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-06-21 17:37:27 +02:00
parent d1c4a7389f
commit a610dd9e32

View File

@ -20,7 +20,7 @@ Ext.define('Proxmox.Markdown', {
for (let i=node.attributes.length; i--;) {
const name = node.attributes[i].name;
// TODO: we may want to also disallow class and id attrs
if (!/^(class|id|name|href|src|alt|align|valign)$/i.test(name)) {
if (!/^(class|id|name|href|src|alt|align|valign|disabled|checked|start|type)$/i.test(name)) {
node.attributes.removeNamedItem(name);
}
}