aboutsummaryrefslogtreecommitdiff
path: root/static/user
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-04-24 01:58:22 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-04-24 01:58:22 +0200
commitb6b59cdb3ce70c7b119f4f126c05f613421d5b99 (patch)
treed4e0ff19b85ec225fcbba594eddd4b44d4ded327 /static/user
parentMinor dependency fixup in static/Makefile. (diff)
downloadcalp-b6b59cdb3ce70c7b119f4f126c05f613421d5b99.tar.gz
calp-b6b59cdb3ce70c7b119f4f126c05f613421d5b99.tar.xz
Change user-additions HTML detection.
Diffstat (limited to 'static/user')
-rw-r--r--static/user/user-additions.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/static/user/user-additions.js b/static/user/user-additions.js
index c9ebe1a4..d357b4b5 100644
--- a/static/user/user-additions.js
+++ b/static/user/user-additions.js
@@ -1,6 +1,7 @@
window.formatters.set('description', (el, d) => {
- if (/<br\/?>/.exec(d)) {
- /* Assume that the text is HTML iff it contains a <br/> tag */
+ if (/<\/?\w+( \w+(="?\w+"?)?)*\/?>/.exec(d)) {
+ /* Assume that the text is HTML if it contains something which looks
+ like an HTML tag */
let parser = new DOMParser();
let doc = parser.parseFromString(d, 'text/html');
el.replaceChildren(doc.body);