From 50242c572e33cd9b80d8f190e6ffc382fe8fe64b Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 8 Jul 2023 09:04:55 -0300 Subject: content: transformContent: be more selective about paragraph breaks --- src/content/dependencies/transformContent.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/content/dependencies/transformContent.js b/src/content/dependencies/transformContent.js index 57404bae..7010e9de 100644 --- a/src/content/dependencies/transformContent.js +++ b/src/content/dependencies/transformContent.js @@ -270,10 +270,13 @@ export default { // Compress multiple line breaks into single line breaks. .replace(/\n{2,}/g, '\n') - // Expand line breaks which don't follow a list. - .replace(/(? / " ". + .replace(/(?.*| $|
$)\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(/(?<=^ *-.*)\n+(?!^ *-)/gm, '\n\n') + // Expand line breaks which are at the end of a quote. + .replace(/(?<=^>.*)\n+(?!^>)/gm, '\n\n'); return marked.parse(markedInput, markedOptions); } -- cgit 1.3.0-6-gf8a5