fix: match new line instead of $ in MarkdownRenderer.attachHeadingsDescriptions

This commit is contained in:
TJT 2021-12-30 23:19:52 +08:00
parent 07e2246ada
commit 33a6e43986

View File

@ -101,7 +101,7 @@ export class MarkdownRenderer {
attachHeadingsDescriptions(rawText: string) {
const buildRegexp = (heading: MarkdownHeading) => {
return new RegExp(`##?\\s+${heading.name.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')}\s*$`);
return new RegExp(`##?\\s+${heading.name.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')}\s*\n`);
};
const flatHeadings = this.flattenHeadings(this.headings);