From 82ab72dae3892d5c13e0cb9e11942f3ed4699505 Mon Sep 17 00:00:00 2001 From: Zoe <62722391+juls0730@users.noreply.github.com> Date: Sat, 28 Feb 2026 17:20:58 -0600 Subject: [PATCH] revert: no longer preprocess markdown to make singlenewlines double, breaks table rendering --- app/components/Markdown/Renderer.vue | 66 ++++++++++++++-------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/app/components/Markdown/Renderer.vue b/app/components/Markdown/Renderer.vue index 039bb33..a20ac4c 100644 --- a/app/components/Markdown/Renderer.vue +++ b/app/components/Markdown/Renderer.vue @@ -21,47 +21,47 @@ const { $remark } = useNuxtApp(); // since we are a web editor, with line wrapping, that behavior // in undesirable, so pre preserve newlines by just maiking // every new line two newlines (as long as we arent in a codeblock) -function preprocessMarkdown(doc: string) { - const lines = doc.split('\n'); - let inCode = false; - let result: string[] = []; +// function preprocessMarkdown(doc: string) { +// const lines = doc.split('\n'); +// let inCode = false; +// let result: string[] = []; - for (let i = 0; i < lines.length; i++) { - const fullLine = lines[i]!; +// for (let i = 0; i < lines.length; i++) { +// const fullLine = lines[i]!; - const match = fullLine.match(/^( {0,3})(.*)/); - const content = match?.[2] || ''; +// const match = fullLine.match(/^( {0,3})(.*)/); +// const content = match?.[2] || ''; - if (content.startsWith('```')) { - if (!inCode) { - inCode = true; - } else { - inCode = false; - } - result.push(fullLine); - continue; - } +// if (content.startsWith('```')) { +// if (!inCode) { +// inCode = true; +// } else { +// inCode = false; +// } +// result.push(fullLine); +// continue; +// } - if (inCode) { - result.push(fullLine); - } else { - if (content.trim().length === 0) { - result.push(''); - } else { - if (result.length > 0 && result[result.length - 1] !== '') { - result.push(''); - } - result.push(fullLine); - } - } - } +// if (inCode) { +// result.push(fullLine); +// } else { +// if (content.trim().length === 0) { +// result.push(''); +// } else { +// if (result.length > 0 && result[result.length - 1] !== '') { +// result.push(''); +// } +// result.push(fullLine); +// } +// } +// } - return result.join('\n'); -} +// return result.join('\n'); +// } const ast = computed(() => { - const mdast = $remark.parse(preprocessMarkdown(props.content)); + const mdast = $remark.parse(props.content); return $remark.runSync(mdast); });