From 54fcaf80b00673b5edfe95dcc6a30f6f0b96900d Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 12 Oct 2024 22:39:40 +0200 Subject: [PATCH] Use a global regex for replaceAll --- src/utils/enhance-content.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/enhance-content.js b/src/utils/enhance-content.js index 15c215bd..fc048169 100644 --- a/src/utils/enhance-content.js +++ b/src/utils/enhance-content.js @@ -27,7 +27,7 @@ const CODE_BLOCK_END_REGEX = /```$/; const INLINE_CODE_REGEX = /`[^`]+`/; const TWITTER_DOMAIN_REGEX = /(twitter|x)\.com/i; const TWITTER_MENTION_REGEX = /@[a-zA-Z0-9_]+@(twitter|x)\.com/; -const TWITTER_MENTION_CAPTURE_REGEX = /(@([a-zA-Z0-9_]+)@(twitter|x)\.com)/; +const TWITTER_MENTION_CAPTURE_REGEX = /(@([a-zA-Z0-9_]+)@(twitter|x)\.com)/g; function createDOM(html, isDocumentFragment) { const tpl = document.createElement('template');