Data fixes, fix for <img> with 2+ src attributes

This commit is contained in:
Will Boyd
2025-02-23 13:22:32 -05:00
parent f0e8400ccd
commit db5430117e
4 changed files with 69 additions and 23 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ export function getPostContent(content) {
if (shared.config.saveImages === 'scraped' || shared.config.saveImages === 'all') {
// writeImageFile() will save all content images to a relative /images
// folder so update references in post content to match
content = content.replace(/(<img[^>]*src=").*?([^/"]+\.(?:gif|jpe?g|png|webp))("[^>]*>)/gi, '$1images/$2$3');
content = content.replace(/(<img\s[^>]*?src=").*?([^/"]+\.(?:gif|jpe?g|png|webp))("[^>]*>)/gi, '$1images/$2$3');
}
// preserve "more" separator, max one per post, optionally with custom label