From b5a776dc365802a2aec94f77ec7a1ff450fe4b20 Mon Sep 17 00:00:00 2001 From: "az@aws" Date: Tue, 16 Apr 2024 17:41:05 -0700 Subject: [PATCH] Fix (some) blockquotes, add empty line between paragraphs --- src/renderer.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/renderer.ts b/src/renderer.ts index ca7159e..49c33e6 100644 --- a/src/renderer.ts +++ b/src/renderer.ts @@ -94,6 +94,15 @@ async function postProcessRenderedHTML(plugin: QuipPlugin, inputFile: TFile, wra } } } + + const fixableBlockquotes = Array.from(wrapper.querySelectorAll('blockquote > p:only-child')) + fixableBlockquotes.forEach(e => e.replaceWith(...Array.from(e.childNodes))) + + const consecutiveP = Array.from(wrapper.querySelectorAll('p + p')) + consecutiveP.forEach(e => { + const spacer = createEl('br') + e.before(spacer) + }) // Remove YAML frontmatter from the output if (plugin.settings.removeYAML) { Array.from(wrapper.querySelectorAll('.frontmatter, .frontmatter-container'))