-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unwrapNoscriptImages missing some images #15
Comments
jedevc
added a commit
to jedevc/go-readability
that referenced
this issue
May 10, 2022
Apply the patch from go-shiori#15
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
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.
The text was updated successfully, but these errors were encountered: