Skip to content

Commit 1309131

Browse files
fix(SNR-217): improve regex for link matching in replaceHTMLinks function
1 parent 0e8f5d7 commit 1309131

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wp-react-lib/src/util/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const replaceHTMLinks = (html, locale) => {
4343

4444
let link;
4545
// Match both absolute (http/https) and relative WP links in a single pass
46-
let linkRegex = /href\s*=\s*(['"])(https?:\/\/.+?|\/wp\/[^'"\s>]+)\1/ig;
46+
let linkRegex = /href\s*=\s*(['"])(https?:\/\/.*?|\/wp\/.*?)\1/ig;
4747

4848
let newHtml = html
4949
while ((link = linkRegex.exec(html)) !== null) {

0 commit comments

Comments
 (0)