Skip to content
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

Image with double-newline #497

Open
ivan-kuzma-scx opened this issue Aug 5, 2022 · 7 comments
Open

Image with double-newline #497

ivan-kuzma-scx opened this issue Aug 5, 2022 · 7 comments
Labels

Comments

@ivan-kuzma-scx
Copy link

ivan-kuzma-scx commented Aug 5, 2022

Hello @spencermountain ,

just found one thing with first sentence while parsing Jesus topic.
https://en.wikipedia.org/wiki/Jesus
image
image

Cheers

spencermountain added a commit that referenced this issue Aug 7, 2022
@spencermountain
Copy link
Owner

thanks, got a fix for this on dev

@ivan-kuzma-scx
Copy link
Author

Thank you!

@ivan-kuzma-scx
Copy link
Author

Hello @spencermountain , have found another one.
Not sure if they are related.

https://en.wikipedia.org/wiki/Byzantine_Empire

image

@spencermountain
Copy link
Owner

thanks @Patrik-scx - i've reproduced this below:

let str = `The '''Byzantine Empire''' {{IPAc-en|z|{|n}} also referred to as the Eastern Roman Empire`
let doc = wtf(str)
console.log(doc.sentences()[0].text())

looks like the IPAc template is getting caught on the { character. Will add this to the next release.
cheers

@ivan-kuzma-scx
Copy link
Author

Cheers

@ivan-kuzma-scx
Copy link
Author

ivan-kuzma-scx commented Nov 29, 2022

Hello @spencermountain ,

Just found additional meta in first sentence of "Jewish diaspora".
Знімок екрана 2022-11-29 о 13 23 06

@spencermountain
Copy link
Owner

spencermountain commented Dec 9, 2022

here's the issue - the <br/> tag becomes a double-newline, which is considered two paragraphs, which trips the image parser:

str = `[[File:Jewish people around the world.svg|thumb|Map of the Jewish diaspora.<br/>
foobar]]`
let doc = wtf(str)
console.log(doc.images())
// []

this may be a stumper. I'm pretty wary of supporting links that span paragraphs
cheers

@spencermountain spencermountain changed the title Jesus first sentence Image with double-newline Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants