From 855c1571f9287b6bfab9ab8e085d5f2cfb8491d5 Mon Sep 17 00:00:00 2001 From: Erin Date: Thu, 4 Sep 2025 18:29:32 -0400 Subject: [PATCH] asdf --- temp.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 temp.js diff --git a/temp.js b/temp.js new file mode 100644 index 0000000..56f0961 --- /dev/null +++ b/temp.js @@ -0,0 +1,19 @@ +const flavorTextRegexp = /\| flavor-text = ([\s\S]+?)\n\|/; +const flavorTextReplacement = newFlavorText => `| flavor-text = ${newFlavorText}\n|` + +function fixPageContent (pageContent) { + let match = pageContent.match(flavorTextRegexp); + if (!match) return pageContent; + + let flavorText = match[1]; + let newFlavorText = flavorText + // linebreaks with no preceding
or
etc + .replace(/(?)\n/g, '
\n') + // spans that set color via inline style instead of using {{colorize}} + .replace(/([^<]+)<\/span>/g, '`$1`') + .replace(/([^<]+)<\/span>/g, '``$1``') + + return pageContent.replace(flavorTextRegexp, flavorTextReplacement(newFlavorText)); +} + +const pages = //...