Skip to content

Commit 005ba47

Browse files
committedSep 16, 2016
fix: wikpedia transform only grabs one image from .infobox
1 parent 44d3a54 commit 005ba47

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed
 

‎dist/iris.js

+5-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/iris.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/extractors/custom/wikipedia.org/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ const WikipediaExtractor = {
1010
// transform top infobox to an image with caption
1111
transforms: {
1212
'.infobox img': ($node) => {
13-
$node.parents('.infobox').prepend($node);
13+
const $parent = $node.parents('.infobox');
14+
// Only prepend the first image in .infobox
15+
if ($parent.children('img').length === 0) {
16+
$parent.prepend($node);
17+
}
1418
},
1519
'.infobox caption': 'figcaption',
1620
'.infobox': 'figure',

0 commit comments

Comments
 (0)
Please sign in to comment.