mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-06-05 15:09:59 +09:00
Merge pull request #113 from lonekorean/fix-bad-attachment
Add check for attachment.attachment_url
This commit is contained in:
+1
-1
@@ -113,7 +113,7 @@ function getPostCoverImageId(postData) {
|
|||||||
function collectAttachedImages(channelData) {
|
function collectAttachedImages(channelData) {
|
||||||
const images = getItemsOfType(channelData, 'attachment')
|
const images = getItemsOfType(channelData, 'attachment')
|
||||||
// filter to certain image file types
|
// filter to certain image file types
|
||||||
.filter(attachment => (/\.(gif|jpe?g|png)$/i).test(attachment.attachment_url[0]))
|
.filter(attachment => attachment.attachment_url && (/\.(gif|jpe?g|png)$/i).test(attachment.attachment_url[0]))
|
||||||
.map(attachment => ({
|
.map(attachment => ({
|
||||||
id: attachment.post_id[0],
|
id: attachment.post_id[0],
|
||||||
postId: attachment.post_parent[0],
|
postId: attachment.post_parent[0],
|
||||||
|
|||||||
Reference in New Issue
Block a user