mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-11-09 04:30:36 +09:00
remove query string from images
This commit is contained in:
+1
-1
@@ -117,7 +117,7 @@ export function getPostContent(content) {
|
|||||||
if (shared.config.saveImages === 'scraped' || shared.config.saveImages === 'all') {
|
if (shared.config.saveImages === 'scraped' || shared.config.saveImages === 'all') {
|
||||||
// writeImageFile() will save all content images to a relative /images
|
// writeImageFile() will save all content images to a relative /images
|
||||||
// folder so update references in post content to match
|
// 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
|
// preserve "more" separator, max one per post, optionally with custom label
|
||||||
|
|||||||
Reference in New Issue
Block a user