Use markdown engine to enable/disable smart paste (#202192)

Fixes #188863
Fixes #188958
Fixes #188868

This is more reliable than using the regular expressions. However the regular expressions are still needed for inline elements
This commit is contained in:
Matt Bierner
2024-01-10 14:32:58 -08:00
committed by GitHub
parent 0bb69da87c
commit 8f32885359
7 changed files with 180 additions and 73 deletions

View File

@@ -118,6 +118,12 @@ export class MarkdownItEngine implements IMdParser {
});
}
public async getEngine(resource: vscode.Uri | undefined): Promise<MarkdownIt> {
const config = this._getConfig(resource);
return this._getEngine(config);
}
private async _getEngine(config: MarkdownItConfig): Promise<MarkdownIt> {
if (!this._md) {
this._md = (async () => {