1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-14 04:49:59 +00:00
elk/patches/mlly@1.0.0.patch

17 lines
877 B
Diff
Raw Normal View History

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") {