mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 08:36:33 +03:00
fix: broken rendering of headings with regexp characters
This commit is contained in:
parent
ec8f6dc09e
commit
e660517a2a
|
@ -78,7 +78,9 @@ export class MarkdownRenderer {
|
|||
}
|
||||
|
||||
attachHeadingsDescriptions(rawText: string) {
|
||||
const buildRegexp = heading => new RegExp(`##?\\s+${heading.name}`);
|
||||
const buildRegexp = heading => {
|
||||
return new RegExp(`##?\\s+${heading.name.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')}`);
|
||||
};
|
||||
|
||||
const flatHeadings = this.flattenHeadings(this.headings);
|
||||
if (flatHeadings.length < 1) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user