Skip to content

Commit

Permalink
Escape command title for CodeLens
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof-Cieslak committed Oct 5, 2016
1 parent cd6fb06 commit 39a3862
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/vs/editor/contrib/codelens/browser/codelens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {RunOnceScheduler, asWinJsPromise} from 'vs/base/common/async';
import {onUnexpectedError} from 'vs/base/common/errors';
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
import Severity from 'vs/base/common/severity';
import {format} from 'vs/base/common/strings';
import {format, escape} from 'vs/base/common/strings';
import {TPromise} from 'vs/base/common/winjs.base';
import * as dom from 'vs/base/browser/dom';
import {ICommandService} from 'vs/platform/commands/common/commands';
Expand Down Expand Up @@ -114,12 +114,13 @@ class CodeLensContentWidget implements editorBrowser.IContentWidget {
let html: string[] = [];
for (let i = 0; i < symbols.length; i++) {
let command = symbols[i].command;
let title = escape(command.title);
let part: string;
if (command.id) {
part = format('<a id={0}>{1}</a>', i, command.title);
part = format('<a id={0}>{1}</a>', i, title);
this._commands[i] = command;
} else {
part = format('<span>{0}</span>', command.title);
part = format('<span>{0}</span>', title);
}
html.push(part);
}
Expand Down

0 comments on commit 39a3862

Please sign in to comment.