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
Handling Template:Br_list in infoboxes? #516
Labels
Comments
Yep - sure, I can look at this this week. |
That's great, thanks! |
got a fix for this for the next release, for now you can do this let str = `{{Infobox officeholder
| name = Romina Pérez
| office2 = {{Br list|Member of the [[Chamber of Deputies (Bolivia)|Chamber of Deputies]]|from [[Cochabamba Department|Cochabamba]]}}
}}`
wtf.extend((models, templates) => {
templates['br list'] = templates['br separated entries']
})
//should work now:
let doc = wtf(str)
console.log(doc.infobox().json())
/*
{
name: { text: 'Romina Pérez' },
office2: { text: 'Member of the Chamber of Deputies\n\nfrom Cochabamba' }
}
*/ cheers |
Oh, very nice. That seems to do the trick nicely for now. Thanks! |
Merged
fixed in v10.1.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When an infobox switches from an explicit
<br>
tag to use{{Br list}}
instead (e.g. at https://en.wikipedia.org/w/index.php?title=Romina_P%C3%A9rez&diff=1136738344&oldid=1131803626), that entry entirely vanishes from theinfoboxes
section of the wtf_wikipedia output (ie in this casewtf_wikipedia https://en.wikipedia.org/wiki/Romina_P%C3%A9rez | jq -r . | fgrep office2
has no results)It does appear in the
templates
section:but I can't see a way to tie those back together. Am I overlooking something? Or might it be possible to handle this template in a way the retains the value?
The text was updated successfully, but these errors were encountered: