Skip to content

Commit

Permalink
Merge pull request #12686 from erik-krogh/backtick-parse-error
Browse files Browse the repository at this point in the history
JS: add backticks around the concrete parse error
  • Loading branch information
erik-krogh authored Mar 31, 2023
2 parents cc841a6 + 4b3a419 commit 1e1a692
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ private void doExtract(FileExtractor extractor, Path file, ExtractorState state)
if (!extractor.getConfig().isExterns()) seenFiles = true;
List<ParseError> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 1e1a692

Please sign in to comment.