]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
fix #4756: markdown notes: allow any valid URL for a tags
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 3 Jun 2023 10:25:36 +0000 (12:25 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 3 Jun 2023 11:41:23 +0000 (13:41 +0200)
As anchor elements cannot load things into the current browsing
context and are not necessarily more dangerous to users compared to
HTTP(S) links, which we allowed since adding markdown rendering in
the first place.

Allows adding short-cuts for virtual guest resources, like RDP or SSH
links.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/Parser.js

index e283df8a058c500bd9582cb0111da9f29ef639f8..08e2502e0dc99ec154cc338ae66d518396af7b79 100644 (file)
@@ -34,6 +34,7 @@ Ext.define('Proxmox.Markdown', {
                        let url = new URL(value, window.location.origin);
                        if (
                            _isHTTPLike(url.protocol) ||
+                           node.tagName.toLowerCase() === 'a' ||
                            (node.tagName.toLowerCase() === 'img' && url.protocol.toLowerCase() === 'data:')
                        ) {
                            node.attributes[i].value = url.href;