Add codeql comments and small fix (#185931)

This commit is contained in:
Matt Bierner
2023-06-22 17:40:39 -07:00
committed by GitHub
parent 04a2bbc6e0
commit 5ee455116f
6 changed files with 7 additions and 7 deletions

View File

@@ -103,7 +103,7 @@ class JsDocCompletionProvider implements vscode.CompletionItemProvider {
export function templateToSnippet(template: string): vscode.SnippetString {
// TODO: use append placeholder
let snippetIndex = 1;
template = template.replace(/\$/g, '\\$');
template = template.replace(/\$/g, '\\$'); // CodeQL [SM02383] This is only used for text which is put into the editor. It is not for rendered html
template = template.replace(/^[ \t]*(?=(\/|[ ]\*))/gm, '');
template = template.replace(/^(\/\*\*\s*\*[ ]*)$/m, (x) => x + `\$0`);
template = template.replace(/\* @param([ ]\{\S+\})?\s+(\S+)[ \t]*$/gm, (_param, type, post) => {

View File

@@ -217,7 +217,7 @@ function convertLinkTags(
}
function escapeMarkdownSyntaxTokensForCode(text: string): string {
return text.replace(/`/g, '\\$&');
return text.replace(/`/g, '\\$&'); // CodeQL [SM02383] This is only meant to escape backticks. The Markdown is fully sanitized after being rendered.
}
export function tagsToMarkdown(