Browse Source

Wikipedia: improve parser

master
parent
commit
982fd2dc60
  1. 9
      src/wikipedia.js

9
src/wikipedia.js

@ -36,12 +36,15 @@ function prepare (text) {
return null
}
var p = content.getElementsByTagName('p')
if (!p.length) {
var p = content.firstChild.firstChild
while (p && p.tagName !== 'P') {
p = p.nextSibling
}
if (!p) {
return null
}
p = p[0]
stripLinks(p)
return p.innerHTML

Loading…
Cancel
Save