diff --git a/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java b/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java index 3b86ed15f8e5..346d31231df9 100644 --- a/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java +++ b/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java @@ -1236,7 +1236,7 @@ private void doExtract(FileExtractor extractor, Path file, ExtractorState state) if (!extractor.getConfig().isExterns()) seenFiles = true; List errors = loc == null ? Collections.emptyList() : loc.getParseErrors(); for (ParseError err : errors) { - String msg = "A parse error occurred: " + StringUtil.escapeMarkdown(err.getMessage()) + String msg = "A parse error occurred: " + StringUtil.quoteWithBackticks(err.getMessage().trim()) + ". Check the syntax of the file. If the file is invalid, correct the error or [exclude](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning) the file from analysis."; // file, relative to the source root String relativeFilePath = null; diff --git a/javascript/ql/integration-tests/all-platforms/diagnostics/syntax-error/diagnostics.expected b/javascript/ql/integration-tests/all-platforms/diagnostics/syntax-error/diagnostics.expected index 0c4405ea92b0..c1ee74852189 100644 --- a/javascript/ql/integration-tests/all-platforms/diagnostics/syntax-error/diagnostics.expected +++ b/javascript/ql/integration-tests/all-platforms/diagnostics/syntax-error/diagnostics.expected @@ -6,7 +6,7 @@ "startColumn": 4, "startLine": 1 }, - "markdownMessage": "A parse error occurred: Unexpected token. Check the syntax of the file. If the file is invalid, correct the error or [exclude](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning) the file from analysis.", + "markdownMessage": "A parse error occurred: `Unexpected token`. Check the syntax of the file. If the file is invalid, correct the error or [exclude](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning) the file from analysis.", "severity": "warning", "source": { "extractorName": "javascript",