mirror of
https://github.com/Microsoft/vscode
synced 2024-10-03 01:46:42 +00:00
Merge remote-tracking branch 'origin/main' into tyriar/133524
This commit is contained in:
commit
b83c156a99
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue