提交 a3f05f77 编写于 作者: J Johannes Rieken

chore - simpler code rendering

上级 2b44f4ab
...@@ -73,12 +73,8 @@ export class MarkdownRenderer { ...@@ -73,12 +73,8 @@ export class MarkdownRenderer {
modeId = 'plaintext'; modeId = 'plaintext';
} }
this._modeService.triggerMode(modeId); this._modeService.triggerMode(modeId);
await Promise.resolve(true); const tokenization = await TokenizationRegistry.getPromise(modeId) ?? undefined;
const promise = TokenizationRegistry.getPromise(modeId); const code = tokenizeToString(value, tokenization);
if (promise) {
return promise.then(support => tokenizeToString(value, support));
}
const code = tokenizeToString(value, undefined);
return this._options.editor return this._options.editor
? `<span style="font-family: ${this._options.editor.getOption(EditorOption.fontInfo).fontFamily}">${code}</span>` ? `<span style="font-family: ${this._options.editor.getOption(EditorOption.fontInfo).fontFamily}">${code}</span>`
: `<span>${code}</span>`; : `<span>${code}</span>`;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册