remove query string from images

This commit is contained in:
Will Boyd
2025-04-26 13:09:26 -04:00
parent 9d706b5fd6
commit 473a89c411
+1 -1
View File
@@ -117,7 +117,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(?=\s)[^>]+?(?<=\s)src=")[^"]*?([^/"]+)("[^>]*>)/gi, '$1images/$2$3');
content = content.replace(/(<img(?=\s)[^>]+?(?<=\s)src=")[^"]*?([^/"]+?)(\?[^"]*)?("[^>]*>)/gi, '$1images/$2$4');
}
// preserve "more" separator, max one per post, optionally with custom label