make web-ext happy

This commit is contained in:
2025-10-03 23:15:04 +08:00
parent 3b66fedaaa
commit f3e9fe56a0

View File

@@ -136,8 +136,7 @@ class Autolinker {
static findLinks(text) { static findLinks(text) {
// Regex can be tested and verified at https://regex101.com/r/rXoLiT/2. // Regex can be tested and verified at https://regex101.com/r/rXoLiT/2.
this.#regex ??= this.#regex ??=
/\b(?:https?:\/\/|mailto:|www\.)(?:[\S--[\p{P}<>]]|\/|[\S--[\[\]]]+[\S--[\p{P}<>]])+|\b[\S--[@\p{Ps}\p{Pe}<>]]+@([\S--[\p{P}<>]]+(?:\.[\S--[\p{P}<>]]+)+)/gmv; /\b(?:https?:\/\/|mailto:|www\.)(?:[^\s\p{P}<>]|\/|[^\s\[\]]+[^\s\p{P}<>])+|\b[^\s@\p{Ps}\p{Pe}<>]+@([^\s\p{P}<>]+(?:\.[^\s\p{P}<>]+)+)/gmu;
const [normalizedText, diffs] = normalize(text, { ignoreDashEOL: true }); const [normalizedText, diffs] = normalize(text, { ignoreDashEOL: true });
const matches = normalizedText.matchAll(this.#regex); const matches = normalizedText.matchAll(this.#regex);
const links = []; const links = [];