« get me outta code hell

content: transformContent: avoid para breaks in numbered lists - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-06-03 17:19:18 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-03 17:19:18 -0300
commitda969380dd481287c9532e9d85b181747e615ade (patch)
tree7dcee276c18df8c6d64bb699b4f00bb0fd6eb3f6 /src/content/dependencies
parent031b6f2227d663caf1d67d55b45378a69c182574 (diff)
content: transformContent: avoid para breaks in numbered lists
Diffstat (limited to 'src/content/dependencies')
-rw-r--r--src/content/dependencies/transformContent.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js
index 695f1be3..84fbe361 100644
--- a/src/content/dependencies/transformContent.js
+++ b/src/content/dependencies/transformContent.js
@@ -537,9 +537,9 @@ export default {
           // Expand line breaks which don't follow a list, quote,
           // or <br> / "  ", and which don't precede or follow
           // indented text (by at least two spaces).
-          .replace(/(?<!^ *-.*|^>.*|^  .*\n*|  $|<br>$)\n+(?!  |\n)/gm, '\n\n') /* eslint-disable-line no-regex-spaces */
+          .replace(/(?<!^ *(?:-|\d\.).*|^>.*|^  .*\n*|  $|<br>$)\n+(?!  |\n)/gm, '\n\n') /* eslint-disable-line no-regex-spaces */
           // Expand line breaks which are at the end of a list.
-          .replace(/(?<=^ *-.*)\n+(?!^ *-)/gm, '\n\n')
+          .replace(/(?<=^ *(?:-|\d\.).*)\n+(?!^ *(?:-|\d\.))/gm, '\n\n')
           // Expand line breaks which are at the end of a quote.
           .replace(/(?<=^>.*)\n+(?!^>)/gm, '\n\n');