Skip to content

Commit

Permalink
less innerHTML usage, eg. textContent for styles and innerText for la…
Browse files Browse the repository at this point in the history
…bels
  • Loading branch information
jrieken committed Aug 13, 2020
1 parent 5920e71 commit c112f84
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/vs/editor/contrib/codelens/codelensController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class CodeLensContribution implements IEditorContribution {
.monaco-editor .codelens-decoration.${this._styleClassName} { height: ${height}px; line-height: ${lineHeight}px; font-size: ${fontSize}px; padding-right: ${Math.round(fontInfo.fontSize * 0.45)}px;}
.monaco-editor .codelens-decoration.${this._styleClassName} > a > .codicon { line-height: ${lineHeight}px; font-size: ${fontSize}px; }
`;
this._styleElement.innerHTML = newStyle;
this._styleElement.textContent = newStyle;
}

private _localDispose(): void {
Expand Down Expand Up @@ -470,5 +470,3 @@ registerEditorAction(class ShowLensesInCurrentLine extends EditorAction {
}
}
});


2 changes: 1 addition & 1 deletion src/vs/editor/contrib/gotoError/gotoErrorWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class MessageWidget {

let relatedResource = document.createElement('a');
dom.addClass(relatedResource, 'filename');
relatedResource.innerHTML = `${getBaseLabel(related.resource)}(${related.startLineNumber}, ${related.startColumn}): `;
relatedResource.innerText = `${getBaseLabel(related.resource)}(${related.startLineNumber}, ${related.startColumn}): `;
relatedResource.title = getPathLabel(related.resource, undefined);
this._relatedDiagnostics.set(relatedResource, related);

Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/contrib/gotoSymbol/peek/referencesWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ export class ReferenceWidget extends peekView.PeekViewWidget {

if (this._model.isEmpty) {
this.setTitle('');
this._messageContainer.innerHTML = nls.localize('noResults', "No results");
this._messageContainer.innerText = nls.localize('noResults', "No results");
dom.show(this._messageContainer);
return Promise.resolve(undefined);
}
Expand Down

0 comments on commit c112f84

Please sign in to comment.