diff --git a/lib/modules/hosts/redditgallery.js b/lib/modules/hosts/redditgallery.js index 182faa8502..84ab8d819e 100644 --- a/lib/modules/hosts/redditgallery.js +++ b/lib/modules/hosts/redditgallery.js @@ -13,6 +13,7 @@ export default new Host('redditgallery', { async handleLink(href, [, id]) { const { media_metadata = {}, + selftext_html, gallery_data: { items = [], } = {}, @@ -24,6 +25,6 @@ export default new Host('redditgallery', { return type === 'IMAGE' ? [{ type, caption, src: `https://i.redd.it/${media_id}.${m.substr(6)}` }] : undefined; }); if (!pieces.length) throw new Error('Gallery has no valid pieces.'); - return { type: 'GALLERY', src: pieces }; + return { type: 'GALLERY', src: pieces, caption: selftext_html && selftext_html.replace(/<\/?p>/g, '') }; }, });