diff --git a/src/vs/workbench/parts/update/electron-browser/media/markdown.css b/src/vs/workbench/parts/update/electron-browser/media/markdown.css
index 1e792945828..7f28f4be536 100644
--- a/src/vs/workbench/parts/update/electron-browser/media/markdown.css
+++ b/src/vs/workbench/parts/update/electron-browser/media/markdown.css
@@ -91,6 +91,10 @@ code > div {
overflow: auto;
}
+.monaco-tokenized-source {
+ white-space: pre;
+}
+
/** Theming */
.vscode-light {
diff --git a/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts b/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts
index 8fddc612332..4f324536962 100644
--- a/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts
+++ b/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts
@@ -25,6 +25,8 @@ import { Keybinding } from 'vs/base/common/keybinding';
import { IRequestService } from 'vs/platform/request/common/request';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import product from 'vs/platform/product';
+import { IModeService } from 'vs/editor/common/services/modeService';
+import {tokenizeToString} from 'vs/editor/common/modes/textToHtmlTokenizer';
function renderBody(body: string): string {
return `
@@ -52,7 +54,8 @@ export class ReleaseNotesEditor extends BaseEditor {
@IWorkbenchEditorService private editorService: IWorkbenchEditorService,
@IRequestService private requestService: IRequestService,
@IOpenerService private openerService: IOpenerService,
- @IKeybindingService private keybindingService: IKeybindingService
+ @IKeybindingService private keybindingService: IKeybindingService,
+ @IModeService private modeService: IModeService
) {
super(ReleaseNotesEditor.ID, telemetryService);
this.disposables = [];
@@ -81,7 +84,29 @@ export class ReleaseNotesEditor extends BaseEditor {
this.loadContents(() => this.requestService.request({ url })
.then(asText)
.then(text => this.patchKeybindings(text))
- .then(marked.parse)
+ .then(text => {
+ // we first need to load the modes...
+ const result = [];
+ const renderer = new marked.Renderer();
+ renderer.code = (code, lang) => {
+ const modeId = this.modeService.getModeIdForLanguageName(lang);
+ result.push(this.modeService.getOrCreateMode(modeId));
+ return '';
+ };
+
+ marked(text, { renderer });
+ return TPromise.join(result).then(() => text);
+ })
+ .then(text => {
+ // then we can render
+ const renderer = new marked.Renderer();
+ renderer.code = (code, lang) => {
+ const modeId = this.modeService.getModeIdForLanguageName(lang);
+ return `${ tokenizeToString(code, modeId) }`;
+ };
+
+ return marked(text, { renderer });
+ })
.then(renderBody)
.then(body => {
const webview = new WebView(