mirror of
https://github.com/fmhy/edit.git
synced 2025-08-14 15:12:38 +10:00
fix(md): correctly append feedback on linked headings
This commit is contained in:
parent
6d6b4abe9f
commit
af5bf1a445
1 changed files with 1 additions and 1 deletions
|
@ -40,7 +40,7 @@ export const headersPlugin = (md: MarkdownRenderer) => {
|
||||||
//
|
//
|
||||||
// The token after `heading_open` contains the link as a child token.
|
// The token after `heading_open` contains the link as a child token.
|
||||||
const children = tokens[idx + 1].children || []
|
const children = tokens[idx + 1].children || []
|
||||||
const linkOpenToken = children.find((c) => c.type === 'link_open')
|
const linkOpenToken = children.findLast((c) => c.type === 'link_open')
|
||||||
if (!linkOpenToken) return result
|
if (!linkOpenToken) return result
|
||||||
|
|
||||||
const heading = tokens[idxClose - 1]
|
const heading = tokens[idxClose - 1]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue