You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The page returns infobox.image() as one path for two files and the current solution is redirecting as a combined entity as opposed to an array of entities. You can fix that changing lines: 4 to 11 but I don't know how would that affect your code
Fix
//src/image/Image.js//line 4constencodeTitle=function(path: string) :string[]{//separate files using split() join()letpaths=path.split(".svg").join(".svg{}")//repeat for all kinds of media.split("{}");//remove all falsey values I usually use lodash and I just noticed I don't know//which method is best if not using lodash but here, (whenever the image path only contains one file the second index is falsey)paths.filter(file=>{returnfile!=undefined&&file!=''&&file!=null;});paths.map(file=>{lettitle=file.replace(/^(image|file?)\:/i,'');//titlecase ittitle=title.charAt(0).toUpperCase()+title.substring(1);//spaces to underscorestitle=title.trim().replace(//g,'_');returntitle;})returnpaths;}
I know you probably can code this with a regex but I don't know how, so whenever you do Ill see it.
The text was updated successfully, but these errors were encountered:
thanks Miguel - yeah, good find. This is the first case I've seen of two images in one infobox property - we are grabbing the logo text without a test, or validation.
For reference:
{{Infobox website
| name = Facebook
| logo = [[File:Facebook f logo (2019).svg |100px]]<br/><br/>[[File:Facebook Logo (2019).svg|196px]]
}}}
We're stuck behind a breaking change on dev branch, but i'm happy to add this to the next release, which may be in a few weeks.
cheers
Test case:
https://en.wikipedia.org/wiki/Facebook
Issue
The page returns infobox.image() as one path for two files and the current solution is redirecting as a combined entity as opposed to an array of entities. You can fix that changing lines: 4 to 11 but I don't know how would that affect your code
Fix
I know you probably can code this with a regex but I don't know how, so whenever you do Ill see it.
The text was updated successfully, but these errors were encountered: