Skip to content

Commit

Permalink
fix: update transform
Browse files Browse the repository at this point in the history
  • Loading branch information
kev5873 committed Feb 6, 2017
1 parent 8a6b641 commit 7798ac4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/extractors/custom/pagesix.com/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const PagesixComExtractor = {

author: {
selectors: [
'p.byline',
'.byline',
],
},

Expand Down Expand Up @@ -43,7 +43,11 @@ export const PagesixComExtractor = {
// Is there anything in the content you selected that needs transformed
// before it's consumable content? E.g., unusual lazy loaded images
transforms: {
'#featured-image-wrapper': 'figure',
'#featured-image-wrapper': ($node) => {
const sourceSet = $node.find('source').first().attr('srcset');
const largestImg = sourceSet.split(' ')[0];
$node.replaceWith(`<img src="${largestImg}" />`);
},
},

// Is there anything that is in the result that shouldn't be?
Expand Down

0 comments on commit 7798ac4

Please sign in to comment.