elk/patches/mlly@1.0.0.patch
2023-01-08 11:15:21 +01:00

17 lines
No EOL
877 B
Diff

diff --git a/dist/index.mjs b/dist/index.mjs
index 6b5fb1566bee73cefdf165519146604b59ebe7a5..8df0f81f3df4c13bf06b003c472c46db9772db91 100644
--- a/dist/index.mjs
+++ b/dist/index.mjs
@@ -972,10 +972,10 @@ function fileURLToPath(id) {
}
const INVALID_CHAR_RE = /[\u0000-\u001F"#$&*+,/:;<=>?@[\]^`{|}\u007F]+/g;
function sanitizeURIComponent(name = "", replacement = "_") {
- return name.replace(INVALID_CHAR_RE, replacement);
+ return name.replace(INVALID_CHAR_RE, replacement).replace(/%../g, replacement);
}
function sanitizeFilePath(filePath = "") {
- return filePath.split(/[/\\]/g).map((p) => sanitizeURIComponent(p)).join("/").replace(/^([A-Za-z])_\//, "$1:/");
+ return filePath.replace(/[?#].*$/, '').split(/[/\\]/g).map((p) => sanitizeURIComponent(p)).join("/").replace(/^([A-Za-z])_\//, "$1:/");
}
function normalizeid(id) {
if (typeof id !== "string") {