diff options
author | 2021-03-21 22:43:28 -0700 | |
---|---|---|
committer | 2021-03-21 22:43:28 -0700 | |
commit | e1782f9dc95f2c96537db3e4590d424cac4785ae (patch) | |
tree | f30d0e772b6756bdbbb96cdaff8bcbe67b25104a /src | |
parent | 6e4367fd490f9c1748288ac10f2bf27632ae7a03 (diff) | |
download | astro-e1782f9dc95f2c96537db3e4590d424cac4785ae.tar.gz astro-e1782f9dc95f2c96537db3e4590d424cac4785ae.tar.zst astro-e1782f9dc95f2c96537db3e4590d424cac4785ae.zip |
fix markdown header issue
Diffstat (limited to 'src')
-rw-r--r-- | src/micromark-collect-headers.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/micromark-collect-headers.ts b/src/micromark-collect-headers.ts index d614cc5b4..d69a0a358 100644 --- a/src/micromark-collect-headers.ts +++ b/src/micromark-collect-headers.ts @@ -12,6 +12,7 @@ export function createMarkdownHeadersCollector() { atxHeading(node: any) { currentHeader = {}; headers.push(currentHeader); + this.buffer(); }, atxHeadingSequence(node: any) { currentHeader.depth = this.sliceSerialize(node).length; @@ -23,10 +24,10 @@ export function createMarkdownHeadersCollector() { exit: { atxHeading(node: any) { currentHeader.slug = slugger.slug(currentHeader.text); + this.resume(); this.tag(`<h${currentHeader.depth} id="${currentHeader.slug}">`); this.raw(currentHeader.text); this.tag(`</h${currentHeader.depth}>`); - // console.log(this.sliceSerialize(node)); }, } as any, |