mirror of
https://github.com/Redocly/redoc.git
synced 2025-01-31 10:04:08 +03:00
fix: crash on 2-level md heading at the beginning
This commit is contained in:
parent
4b5df22fa0
commit
e9f23f76ae
|
@ -98,7 +98,10 @@ export class MarkdownRenderer {
|
|||
`<a class="share-link" href="#${id}"></a>`
|
||||
);
|
||||
} else if (tokens[idx].hLevel === 2) {
|
||||
const { id } = this.saveHeading(content, this.currentTopHeading.items);
|
||||
const { id } = this.saveHeading(
|
||||
content,
|
||||
this.currentTopHeading && this.currentTopHeading.items,
|
||||
);
|
||||
return (
|
||||
`<a name="${id}"></a>` +
|
||||
`<h${tokens[idx].hLevel} ${SECTION_ATTR}="${id}" id="${id}">` +
|
||||
|
|
Loading…
Reference in New Issue
Block a user