From a506cedd7a28f9443c34487e2997e58e919b09b2 Mon Sep 17 00:00:00 2001
From: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 06 Mar 2024 05:59:37 +0000
Subject: [PATCH] chore(deps-dev): bump @types/node from 20.11.19 to 20.11.24 (#958)
---
quartz/components/renderPage.tsx | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
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 @@
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 @@
endIdx = i
} else if (el.properties?.id === blockRef) {
startIdx = i
+ headerRegex = new RegExp(`h[1-${el.tagName.slice(-1)}]`)
}
}
}
--
Gitblit v1.10.0