From b0c7069a107dcfa37950598494b6ba54719b5bb3 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Sat, 3 Jun 2023 12:33:48 +0200 Subject: [PATCH] markdown parser: normalize tag names and protocol for check As the tag names are often uppercase, and so this was overly strict and didn't always match correctly Signed-off-by: Thomas Lamprecht --- src/Parser.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Parser.js b/src/Parser.js index 0a44230..e283df8 100644 --- a/src/Parser.js +++ b/src/Parser.js @@ -32,7 +32,10 @@ Ext.define('Proxmox.Markdown', { } else if ((name === 'href' || name === 'src') && !_isHTTPLike(value)) { try { let url = new URL(value, window.location.origin); - if (_isHTTPLike(url.protocol) || (node.tagName === 'img' && url.protocol === 'data:')) { + if ( + _isHTTPLike(url.protocol) || + (node.tagName.toLowerCase() === 'img' && url.protocol.toLowerCase() === 'data:') + ) { node.attributes[i].value = url.href; } else { node.attributes.removeNamedItem(name);