-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch anchorme@3.0.5
for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/anchorme/dist/node/regex.js b/node_modules/anchorme/dist/node/regex.js
index 817f906..573a757 100644
--- a/node_modules/anchorme/dist/node/regex.js
+++ b/node_modules/anchorme/dist/node/regex.js
@@ -15,7 +15,14 @@ var fqdn = "(((".concat(protocol, ")?(").concat(domain, "|").concat(ipv4, ")(?=\
exports.email = "\\b(mailto:)?".concat(emailAddress, "@(").concat(domain, "|").concat(ipv4, ")");
exports.url = "(".concat(fqdn, ")").concat(path, "?");
exports.file = "(file:\\/\\/\\/)(?:[a-z]+:(?:\\/|\\\\)+)?([\\w.]+(?:[\\/\\\\]?)+)+";
-exports.final = "(?<=\\b|_)((".concat(exports.email, ")|(").concat(exports.file, ")|(").concat(exports.url, "))(\\b)?");
+
+try {
+ new RegExp('(?<=\\b|_)'); // safari < 17 doesnt like this
+ exports.final = "(?<=\\b|_)((".concat(exports.email, ")|(").concat(exports.file, ")|(").concat(exports.url, "))(\\b)?");
+} catch(err) {
+ exports.final = "(?:\\b|_)((".concat(exports.email, ")|(").concat(exports.file, ")|(").concat(exports.url, "))(\\b)?");
+}
+
exports.finalRegex = new RegExp(exports.final, "gi");
// for validation purposes
exports.ipRegex = new RegExp("^(".concat(ipv4, "|").concat(ipv6, ")$"), "i");
This issue body was partially generated by patch-package.
rokoroku
Metadata
Metadata
Assignees
Labels
No labels