make web-ext happy
This commit is contained in:
@@ -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 = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user