Fix markdown outline for cases without a space after #

Fixes #138027
This commit is contained in:
Matt Bierner
2021-12-06 15:57:43 -08:00
parent 8bf3e4f34e
commit e88394000f

View File

@@ -117,6 +117,6 @@ export class TableOfContentsProvider {
}
private static getHeaderText(header: string): string {
return header.replace(/^\s*#+\s*(.*?)\s*#*$/, (_, word) => word.trim());
return header.replace(/^\s*#+\s*(.*?)(\s+#+)?$/, (_, word) => word.trim());
}
}