Skip to content

filter_external_links truncates colon at the end of URL #333

Description

@harej

Test case:

import mwparserfromhell

wikitext = """
<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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions