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
importmwparserfromhellwikitext="""<ref>{{cite news | first=109th Congress, 1st Session | last=U.S. Senate | title= S. 1033, Secure America and Orderly Immigration Act | date=[[May 12]] [[2005]] | url =http://thomas.loc.gov/cgi-bin/bdquery/z?d109:SN01033: | work =Thomas | accessdate = 2007-09-30 | }}</ref>"""parsed=mwparserfromhell.parse(wikitext)
parsed.filter_external_links()
What I get: ['http://thomas.loc.gov/cgi-bin/bdquery/z?d109:SN01033']
What I should get: ['http://thomas.loc.gov/cgi-bin/bdquery/z?d109:SN01033:'] with the colon at the end
The text was updated successfully, but these errors were encountered:
Note that this is consistent with how MediaWiki behaves 🤷
For your snippet, the thing is that mwparserfromhell does not expand templates so it can't know that the url parameter is actually used inside square brackets.
Test case:
What I get:
['http://thomas.loc.gov/cgi-bin/bdquery/z?d109:SN01033']
What I should get:
['http://thomas.loc.gov/cgi-bin/bdquery/z?d109:SN01033:']
with the colon at the endThe text was updated successfully, but these errors were encountered: