summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeaHOH <Seahoh@Gmail.com>2022-04-06 02:46:33 +0800
committerSeaHOH <Seahoh@Gmail.com>2022-04-06 02:46:33 +0800
commite0a138701f95debef41dcc93a901c03b9ef696d9 (patch)
tree3c8cd4f9d0afbc9120685a63d4ec86c880bfc244
parent082dfd7d85645e71c1e35973f2833c3fbaaf76a7 (diff)
downloadgithub-wc-polyfill-e0a138701f95debef41dcc93a901c03b9ef696d9.tar.gz
Bypass "invalid regexp group" error on GitLab
https://github.com/JustOff/github-wc-polyfill/issues/45#issuecomment-1087765302
-rw-r--r--bootstrap.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/bootstrap.js b/bootstrap.js
index 38ab6dc..bbcd273 100644
--- a/bootstrap.js
+++ b/bootstrap.js
@@ -460,7 +460,8 @@ tracingListener.prototype = {
data = data.replace("\\p{Emoji}", "[\\u{1f300}-\\u{1f5ff}\\u{1f900}-\\u{1f9ff}\\u{1f600}-\\u{1f64f}\\u{1f680}-\\u{1f6ff}\\u{2600}-\\u{26ff}\\u{2700}-\\u{27bf}\\u{1f1e6}-\\u{1f1ff}\\u{1f191}-\\u{1f251}\\u{1f004}\\u{1f0cf}\\u{1f170}-\\u{1f171}\\u{1f17e}-\\u{1f17f}\\u{1f18e}\\u{3030}\\u{2b50}\\u{2b55}\\u{2934}-\\u{2935}\\u{2b05}-\\u{2b07}\\u{2b1b}-\\u{2b1c}\\u{3297}\\u{3299}\\u{303d}\\u{00a9}\\u{00ae}\\u{2122}\\u{23f3}\\u{24c2}\\u{23e9}-\\u{23ef}\\u{25b6}\\u{23f8}-\\u{23fa}]");
// https://gitlab.com/gitlab-org/gitlab/-/merge_requests/79161
// https://gitlab.com/gitlab-org/gitlab/-/commit/87a9ae81bbedd12029edc1f2adcbb4f97e6aaedc
- data = data.replace("/^(?<indent>\\s*)(?<leader>((?<isUl>[*+-])|(?<isOl>\\d+\\.))( \\[([x ])\\])?\\s)(?<content>.)?/", "/^(\\s*)(([*+-]|(\\d+\\.))( \\[[x ]\\])?\\s)(.)?/").replace(/\{leader:.,indent:.,content:.,isOl:.\}=(.)\.groups(?=;)/, "$&={indent:$1[1],leader:$1[2],isOl:$1[4],content:$1[6]}").replace(/(\{indent:.,isOl:.\}=).+?(.)\.groups.+?(?=:\{\},)/, "$1$2?{indent:$2[1],isOl:$2[4]}");
+ // https://gitlab.com/gitlab-org/gitlab/-/commit/775a98516a5c4f35d7320ed1be2dc442937e367b
+ data = data.replace("/^(?<indent>\\s*)(?<leader>((?<isUl>[*+-])|(?<isOl>\\d+\\.))( \\[([xX ])\\])?\\s)(?<content>.)?/", "/^(\\s*)(([*+-]|(\\d+\\.))( \\[[xX ]\\])?\\s)(.)?/").replace(/\{leader:.,indent:.,content:.,isOl:.\}=(.)\.groups(?=;)/, "$&={indent:$1[1],leader:$1[2],isOl:$1[4],content:$1[6]}").replace(/(\{indent:.,isOl:.\}=).+?(.)\.groups.+?(?=:\{\},)/, "$1$2?{indent:$2[1],isOl:$2[4]}");
}
} catch (e) {}
let storageStream = Cc["@mozilla.org/storagestream;1"].createInstance(Ci["nsIStorageStream"]);