File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,13 @@ module.exports = exports = function article(content, format) {
33
33
34
34
content . hasGraphics = Boolean ( content . contentStats && content . contentStats . graphics ) ;
35
35
36
- const countOfGraphics = content . contentStats && content . contentStats . graphics ;
37
- const countOfSharableGraphics = content . embeds ? content . embeds . filter ( embed => embed && embed . type . endsWith ( 'Graphic' ) && embed . canBeSyndicated === 'yes' ) . length : 0 ;
36
+ // Currently embeds can have more than one item for each picture - for different screen sizes
37
+ // We are assuming that canBeSyndicated is the same for all sizes of a picture
38
+ // We are asking if ALL Graphics can be syndicated, which means as long as at least one item
39
+ // can't be, the answer to this is 'no'
40
+ const atLeastOneGraphicCantBeShared = content . embeds && content . embeds . filter ( embed => embed && embed . type . endsWith ( 'Graphic' ) ) . some ( item => item . canBeSyndicated !== 'yes' ) ;
38
41
39
- content . canAllGraphicsBeSyndicated = countOfGraphics > 0 ? countOfSharableGraphics < countOfGraphics : false ;
42
+ content . canAllGraphicsBeSyndicated = Boolean ( atLeastOneGraphicCantBeShared ) ;
40
43
41
44
if ( content . bodyHTML ) {
42
45
content . document = formatArticleXML ( `<body>${ content . bodyHTML } </body>` ) ;
You can’t perform that action at this time.
0 commit comments