mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-28 19:43:43 +03:00
fix: attachHeadingsDescriptions match headings incorrectly (#1845)
* fix: attachHeadingsDescriptions match headings incorrectly * fix: match new line instead of `$` in MarkdownRenderer.attachHeadingsDescriptions Co-authored-by: TJT <tjt@maimemo.com>
This commit is contained in:
parent
831b207715
commit
ea8573dbd7
|
@ -101,7 +101,7 @@ export class MarkdownRenderer {
|
|||
|
||||
attachHeadingsDescriptions(rawText: string) {
|
||||
const buildRegexp = (heading: MarkdownHeading) => {
|
||||
return new RegExp(`##?\\s+${heading.name.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')}`);
|
||||
return new RegExp(`##?\\s+${heading.name.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')}\s*\n`);
|
||||
};
|
||||
|
||||
const flatHeadings = this.flattenHeadings(this.headings);
|
||||
|
|
Loading…
Reference in New Issue
Block a user