summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2020-06-18 18:11:09 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2020-06-18 18:39:44 +0200
commit4ba74efcd05b054a8736400d08e30e7e022a748d (patch)
tree851db1367db596c85ef976738b31644130c23f7a
parentb6de2971a723d42b4ba46d7d6bc25127027a8967 (diff)
Add a-tag support in descriptions.
-rw-r--r--src/ws/node.js16
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
+ }
}
}