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
No known key found for this signature in database
GPG key ID: 099C331567E11888

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());
}
}