diff options
author | SeaHOH <Seahoh@Gmail.com> | 2022-04-06 03:24:49 +0800 |
---|---|---|
committer | SeaHOH <Seahoh@Gmail.com> | 2022-04-06 03:24:49 +0800 |
commit | 1414868b75aa5d3dea1ab60031b0c27631f92486 (patch) | |
tree | c14ddfd0b476dd94e6340b4224a2f309649bf296 | |
parent | c774480839c30b524a106465f5dc5759358613a9 (diff) | |
download | github-wc-polyfill-1414868b75aa5d3dea1ab60031b0c27631f92486.tar.gz |
Bypass "invalid regexp group" error on GitLab BORED
-rw-r--r-- | bootstrap.js | 6 | ||||
-rw-r--r-- | install.rdf | 2 | ||||
-rw-r--r-- | release.cmd | 2 | ||||
-rw-r--r-- | update.xml | 8 |
4 files changed, 10 insertions, 8 deletions
diff --git a/bootstrap.js b/bootstrap.js index bbcd273..8dabbc6 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -456,12 +456,14 @@ tracingListener.prototype = { // https://gitlab.com/gitlab-org/gitlab/-/commit/5522a5ffb6a0522e11dd684cce5c5e99ae6c24ce data = data.replace("/^&(?<iid>\\d+)$/", "/^&(\\d+)$/").replace(".groups.iid", "[1]"); // https://gitlab.com/gitlab-org/gitlab-ui/-/commit/d23c341bb8cef5683bf2d49556dabe4008be76cf + // https://gitlab.com/gitlab-org/gitlab-ui/-/commit/f3fcb2ff5a2e74f77b3a96dc8922a3821c86e2fa // Test URL: https://gitlab.com/ykweyer-test-group/emoji-test - 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}]"); + //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 // 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]}"); + // https://gitlab.com/gitlab-org/gitlab/-/commit/c1e52059b3e4581250f80643f925f1b353555dfe + data = data.replace("/^(?<indent>\\s*)(?<leader>((?<isUl>[*+-])|(?<isOl>\\d+\\.))( \\[([xX ])\\])?\\s)(?<content>.)?/", "/^(\\s*)(([*+-]|(\\d+\\.))( \\[[xX ]\\])?\\s)(.)?/").replace("/^(?<indent>\\s*)(?<leader>((?<isUl>[*+-])|(?<isOl>\\d+\\.))( \\[([xX\\s])\\])?\\s)(?<content>.)?/", "/^(\\s*)(([*+-]|(\\d+\\.))( \\[[xX\\s]\\])?\\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"]); diff --git a/install.rdf b/install.rdf index 6750d04..f566f61 100644 --- a/install.rdf +++ b/install.rdf @@ -2,7 +2,7 @@ <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <Description about="urn:mozilla:install-manifest"> <em:id>github-wc-polyfill@Off.JustOff</em:id> - <em:version>1.2.18</em:version> + <em:version>1.2.18.1</em:version> <em:type>2</em:type> <em:bootstrap>true</em:bootstrap> <em:strictCompatibility>true</em:strictCompatibility> diff --git a/release.cmd b/release.cmd index f8c1335..baff15b 100644 --- a/release.cmd +++ b/release.cmd @@ -1,5 +1,5 @@ @echo off -set VER=1.2.18 +set VER=1.2.18.1 sed -i -E "s/version>.+?</version>%VER%</" install.rdf sed -i -E "s/version>.+?</version>%VER%</; s/download\/.+?\/github-wc-polyfill-.+?\.xpi/download\/%VER%\/github-wc-polyfill-%VER%\.xpi/" update.xml @@ -5,13 +5,13 @@ <RDF:Seq> <RDF:li> <RDF:Description> - <em:version>1.2.18</em:version> + <em:version>1.2.18.1</em:version> <em:targetApplication> <RDF:Description> <em:id>{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}</em:id> <em:minVersion>28.14.0</em:minVersion> <em:maxVersion>29.*</em:maxVersion> - <em:updateLink>https://github.com/JustOff/github-wc-polyfill/releases/download/1.2.18/github-wc-polyfill-1.2.18.xpi</em:updateLink> + <em:updateLink>https://github.com/JustOff/github-wc-polyfill/releases/download/1.2.18/github-wc-polyfill-1.2.18.1.xpi</em:updateLink> </RDF:Description> </em:targetApplication> <em:targetApplication> @@ -19,7 +19,7 @@ <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minVersion>52.9</em:minVersion> <em:maxVersion>52.*</em:maxVersion> - <em:updateLink>https://github.com/JustOff/github-wc-polyfill/releases/download/1.2.18/github-wc-polyfill-1.2.18.xpi</em:updateLink> + <em:updateLink>https://github.com/JustOff/github-wc-polyfill/releases/download/1.2.18/github-wc-polyfill-1.2.18.1.xpi</em:updateLink> </RDF:Description> </em:targetApplication> <em:targetApplication> @@ -27,7 +27,7 @@ <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> <em:minVersion>2.53.4</em:minVersion> <em:maxVersion>2.53.*</em:maxVersion> - <em:updateLink>https://github.com/JustOff/github-wc-polyfill/releases/download/1.2.18/github-wc-polyfill-1.2.18.xpi</em:updateLink> + <em:updateLink>https://github.com/JustOff/github-wc-polyfill/releases/download/1.2.18/github-wc-polyfill-1.2.18.1.xpi</em:updateLink> </RDF:Description> </em:targetApplication> </RDF:Description> |