« get me outta code hell

data: complain about normal <a href> in content strings - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-03-01 07:51:40 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-03-31 17:59:30 -0300
commitbc1ac5e6e89d64136ba5c8bbaf8cee22e6d1d5aa (patch)
treeb1e8ec9aefa6bcd03d1157b3c360135debca03c7 /src
parentfb9d1e9721209c842d186308ba30c9f3201bed4e (diff)
data: complain about normal <a href> in content strings
Using <html:a href> allows bypassing this where it's still
necessary (mainly because we're using a non-link tag as the
content for the link, as in the changelog, and don't support
properly nested nodes just yet).
Diffstat (limited to 'src')
-rw-r--r--src/data/validators.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/data/validators.js b/src/data/validators.js
index 4fc2ac6..b27dd68 100644
--- a/src/data/validators.js
+++ b/src/data/validators.js
@@ -420,6 +420,14 @@ const illegalContentSpec = [
   {illegal: '\u2005', annotation: `four-per-em space`, ...illegalVisibleSpace},
   {illegal: '\u205f', annotation: `medium mathematical space`, ...illegalVisibleSpace},
   {illegal: '\xa0', annotation: `non-breaking space`, ...illegalVisibleSpace},
+
+  {
+    action: 'replace',
+    illegal: '<a href',
+    annotation: `HTML-style link`,
+    with: '[...](...)',
+    withAnnotation: `markdown`,
+  },
 ];
 
 for (const entry of illegalContentSpec) {