diff options
Diffstat (limited to 'src/ws')
-rw-r--r-- | src/ws/node.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/ws/node.js b/src/ws/node.js index b99882b..4da3969 100644 --- a/src/ws/node.js +++ b/src/ws/node.js @@ -254,6 +254,17 @@ function checkHTML(html) var elements = doc.getElementsByTagName("*"); for(let element of elements) { + if(element.tagName == "A") + { + // Accept 'href' attribute in A tag only. + if(element.attributes.length > 1 || !element.hasAttribute("href")) + { + return false; + } + + continue; + } + // Check for allowed tag-names if(element.tagName != "P" && element.tagName != "EM" && @@ -276,7 +287,10 @@ function makeClickthrough(e) var elements = e.getElementsByTagName("*"); for(let element of elements) { - element.style.pointerEvents = "none"; // enable clickthrough to parent + if(element.tagName != "A") + { + element.style.pointerEvents = "none"; // enable clickthrough to parent + } } } |