From 5163504517791cb327423fff9291c91c519b27b6 Mon Sep 17 00:00:00 2001 From: Emile Bangma Date: Wed, 6 Mar 2024 06:53:35 +0100 Subject: [PATCH] fix: transclude all subsections for embedded call (closes #963) (#964) --- quartz/components/renderPage.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quartz/components/renderPage.tsx b/quartz/components/renderPage.tsx index 5394d6f..9309e67 100644 --- a/quartz/components/renderPage.tsx +++ b/quartz/components/renderPage.tsx @@ -106,8 +106,9 @@ export function renderPage( blockRef = blockRef.slice(1) let startIdx = undefined let endIdx = undefined + let headerRegex = /h[1-6]/ for (const [i, el] of page.htmlAst.children.entries()) { - if (el.type === "element" && el.tagName.match(/h[1-6]/)) { + if (el.type === "element" && el.tagName.match(headerRegex)) { if (endIdx) { break } @@ -116,6 +117,7 @@ export function renderPage( endIdx = i } else if (el.properties?.id === blockRef) { startIdx = i + headerRegex = new RegExp(`h[1-${el.tagName.slice(-1)}]`) } } }