-
Notifications
You must be signed in to change notification settings - Fork 98
Open
mislav/go-readability
#10Description
Hi !
the unwrapNoscriptImages() method of the parser uses the image in the noscript tag when there is an image just before it, which works well in that very case. But there is no fallback for when there's no such previous image.
I made my own pre parsing function to fix this behaviours and it seems to work quite well. The idea is to replace the noscript tag in the "else" case of "if prevElement != nil && ps.isSingleImage(prevElement)". Something like that:
} else {
dom.ReplaceChild(noscript.Parent, dom.FirstElementChild(tmpBody), noscript)
}
You can test the difference on https://www.newyorker.com/magazine/2020/06/01/a-window-onto-an-american-nightmare where the cartoons are not visible.
Sorry for not submitting a PR, I can make one if that something you'd prefer.
Metadata
Metadata
Assignees
Labels
No labels