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
Python 3.5.1+ (default, Mar 30 2016, 22:46:26)
[GCC 5.3.1 20160330] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mwparserfromhell as mwp
>>> mwp.__version__
'0.4.3'
>>> mwp.parse("[[File:Fly|thumb|alt=A drawing of a fly from facing up|A fly]]").strip_code()
'thumb|alt=A drawing of a fly from facing up|A fly'
Expected A fly, got thumb|alt=A drawing of a fly from facing up|A fly.
The text was updated successfully, but these errors were encountered:
It seems like that strip_code() should always only return the last block of content in a wikilink, split by |. This would skip the whole thumb and alt=... portions of the link.
OK... so it looks like [[Test|thumb|Bar]] renders as "thumb|Bar", so images are simply crazy. sigh Maybe there would be a good way that I could implement my own strip for a particular node type in strip_code(). E.g. strip_code(for={Wikilink: lambda wl:wl.text.split("|")[-1]})
Expected
A fly
, gotthumb|alt=A drawing of a fly from facing up|A fly
.The text was updated successfully, but these errors were encountered: