« get me outta code hell

escapable '-' and '>' (list/quote) - 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>2022-03-07 20:31:17 -0400
committer(quasar) nebula <qznebula@protonmail.com>2022-03-07 20:31:17 -0400
commite7c19e97447c69fdda5a89fcabda47f136578753 (patch)
tree56d55700792b64a060d371a9b03a7af39b7f13d9 /src
parent0126aca3e2c3d265be0d52728ce031ab27e380f3 (diff)
escapable '-' and '>' (list/quote)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/upd8.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/upd8.js b/src/upd8.js
index 1262fc1a..96fb3106 100755
--- a/src/upd8.js
+++ b/src/upd8.js
@@ -599,6 +599,15 @@ function transformMultiline(text, {
                 inBlockquote = false;
                 outLines.push('</blockquote>');
             }
+
+            // let some escaped symbols display as the normal symbol, since the
+            // point of escaping them is just to avoid having them be treated as
+            // syntax markers!
+            if (lineContent.match(/( *)\\-/)) {
+                lineContent = lineContent.replace('\\-', '-');
+            } else if (lineContent.match(/( *)\\>/)) {
+                lineContent = lineContent.replace('\\>', '>');
+            }
         }
 
         if (lineTag === 'p') {