This commit is contained in:
ErzErzHerzog 2026-05-19 16:26:43 +08:00 committed by GitHub
commit a079fa3e7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1715,7 +1715,7 @@ function convertPathsToLinks(str) {
);
// skip paths inside html tags, like <img src="/path/to/image">
const tagRegex = /(<(?:[^<>"']+|"[^"]*"|'[^']*')*>)/g;
const tagRegex = /(<\/?(?:[A-Za-z][A-Za-z0-9:-]*)(?:\s+[A-Za-z_:][A-Za-z0-9:._-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"=<>`]+))?)*\s*\/?>)/g;//Old pattern= /(<(?:[^<>"']+|"[^"]*"|'[^']*')*>)/g;
return str
.split(tagRegex) // keep tags & text separate