writeDiffRangeDataExtensionPack: escape special characters in filenames
This commit is contained in:
parent
52315a9f7d
commit
3548ff54b5
1 changed files with 5 additions and 1 deletions
|
|
@ -512,7 +512,11 @@ extensions:
|
|||
let data = ranges
|
||||
.map(
|
||||
(range) =>
|
||||
` - ["${range.path}", ${range.startLine}, ${range.endLine}]\n`,
|
||||
// Using yaml.dump() with `forceQuotes: true` ensures that all special
|
||||
// characters are escaped, and that the path is always rendered as a
|
||||
// quoted string on a single line.
|
||||
` - [${yaml.dump(range.path, { forceQuotes: true }).trim()}, ` +
|
||||
`${range.startLine}, ${range.endLine}]\n`,
|
||||
)
|
||||
.join("");
|
||||
if (!data) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue