Skip to content

Commit

Permalink
Merge pull request #5577 from Automattic/update/refactor-post-normalizer
Browse files Browse the repository at this point in the history
Post Normalizer: Refactor rules into individual files
  • Loading branch information
blowery committed Jun 1, 2016
2 parents c0cbb68 + bd91d61 commit 9795211
Show file tree
Hide file tree
Showing 23 changed files with 1,025 additions and 802 deletions.
6 changes: 3 additions & 3 deletions client/lib/feed-post-store/normalization-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ const fastPostNormalizationRules = [
classifyPost
];

function discoverFullBleedImages( post, callback ) {
function discoverFullBleedImages( post, dom ) {
if ( post.site_ID === DISCOVER_BLOG_ID ) {
const images = toArray( post.__contentDOM.querySelectorAll( '.fullbleed img, img.fullbleed' ) );
const images = dom.querySelectorAll( '.fullbleed img, img.fullbleed' );
forEach( images, function( image ) {
const newSrc = resizeImageUrl( image.src, { w: DISCOVER_FULL_BLEED_WIDTH } );
let oldImageObject = find( post.content_images, { src: image.src } );
oldImageObject.src = newSrc;
image.src = newSrc;
} );
}
callback();
return post;
}

/**
Expand Down
Loading

0 comments on commit 9795211

Please sign in to comment.