mirror of
https://github.com/postlight/mercury-parser
synced 2024-11-17 03:25:31 +00:00
improved wiki extractor
This commit is contained in:
parent
52e89a0229
commit
f2729a5ee6
@ -7,9 +7,10 @@ const WikipediaExtractor = {
|
||||
|
||||
// transform top infobox to an image with caption
|
||||
transforms: {
|
||||
'.infobox img': ($node, $) => {
|
||||
'.infobox img': ($node) => {
|
||||
$node.parents('.infobox').prepend($node)
|
||||
},
|
||||
'.infobox caption': 'figcaption',
|
||||
'.infobox': 'figure',
|
||||
},
|
||||
|
||||
@ -17,6 +18,7 @@ const WikipediaExtractor = {
|
||||
clean: [
|
||||
'.mw-editsection',
|
||||
'figure tr, figure td, figure tbody',
|
||||
'#toc',
|
||||
],
|
||||
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user