Skip to content

Commit

Permalink
Only re-render markdown in getting-started steps if it contains code …
Browse files Browse the repository at this point in the history
…blocks (microsoft#170135)

Only re-render markdown in gs step if it contains code blocks
  • Loading branch information
bhavyaus authored Dec 27, 2022
1 parent aa2bb70 commit 706dbe2
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -609,14 +609,16 @@ export class GettingStartedPage extends EditorPane {
}
}));

this.stepDisposables.add(this.themeService.onDidColorThemeChange(async () => {
// Render again since syntax highlighting of code blocks may have changed
const body = await this.detailsRenderer.renderMarkdown(media.path, media.base);
if (!isDisposed) { // Make sure we weren't disposed of in the meantime
webview.html = body;
postTrueKeysMessage();
}
}));
if (rawHTML.indexOf('<code>') >= 0) {
// Render again when Theme changes since syntax highlighting of code blocks may have changed
this.stepDisposables.add(this.themeService.onDidColorThemeChange(async () => {
const body = await this.detailsRenderer.renderMarkdown(media.path, media.base);
if (!isDisposed) { // Make sure we weren't disposed of in the meantime
webview.html = body;
postTrueKeysMessage();
}
}));
}

const layoutDelayer = new Delayer(50);

Expand Down

0 comments on commit 706dbe2

Please sign in to comment.