mirror of
https://github.com/affaan-m/ECC.git
synced 2026-10-26 18:35:05 +00:00
fix: preserve diagnostics after extensionless Windows paths
(cherry picked from commit 2a2e6e3848)
This commit is contained in:
1 parent
58b191c25d
commit
9388e06ec7
2 files changed
+18
-2
No files matched your search
@@ -24,8 +24,8 @@ function normalizeFailureReason(reason) {
|
||||
// Quoted Windows paths preserve spaces in the final path component.
|
||||
.replace(/(["'])(?:[a-z]:[\\/]|\\\\)[^\r\n]*?\1/gu, '$1<path>$1')
|
||||
// Directories may contain spaces, but trailing whitespace separates diagnostic prose.
|
||||
// A colon delimits spaced leaves; trailing separators belong to the path.
|
||||
.replace(/(?:\b[a-z]:|\\)[\\/](?:[^\\/:*?"<>|\r\n]*[^\s\\/:*?"<>|][\\/])*[^\s\\/:*?"<>|(),;]+(?: [^\\/:*?"<>|\r\n]+(?=:))?[\\/]*/gu, '<path>')
|
||||
// Spaced leaves need an extension before a colon, or quotes; preserve extensionless diagnostics.
|
||||
.replace(/(?:\b[a-z]:|\\)[\\/](?:[^\\/:*?"<>|\r\n]*[^\s\\/:*?"<>|][\\/])*[^\s\\/:*?"<>|(),;]+(?: [^\\/:*?"<>|\r\n]*\.[\p{L}\p{N}_-]+(?=:))?[\\/]*/gu, '<path>')
|
||||
// Strip remaining file paths
|
||||
.replace(/(?:\b[a-z]:)?[\\/][\w./\\-]+/g, '<path>')
|
||||
// Collapse whitespace
|
||||
|
||||
Reference in new issue
Block a user