Merge remote-tracking branch 'origin/main' into tyriar/133524

This commit is contained in:
Daniel Imms 2021-12-13 16:57:37 -08:00
commit b83c156a99

View file

@ -164,6 +164,7 @@ export class MarkdownEngine {
): Token[] {
const cached = this._tokenCache.tryGetCached(document, config);
if (cached) {
this.resetSlugCount();
return cached;
}
@ -173,10 +174,14 @@ export class MarkdownEngine {
}
private tokenizeString(text: string, engine: MarkdownIt) {
this._slugCount = new Map<string, number>();
this.resetSlugCount();
return engine.parse(text.replace(UNICODE_NEWLINE_REGEX, ''), {});
}
public resetSlugCount(): void {
this._slugCount = new Map<string, number>();
}
public async render(input: SkinnyTextDocument | string, resourceProvider?: WebviewResourceProvider): Promise<RenderOutput> {
const config = this.getConfig(typeof input === 'string' ? undefined : input.uri);