Skip to content
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

Wrong parsing of an URL with empty hostname #196

Open
lahwaacz opened this issue Aug 27, 2018 · 0 comments
Open

Wrong parsing of an URL with empty hostname #196

lahwaacz opened this issue Aug 27, 2018 · 0 comments

Comments

@lahwaacz
Copy link
Contributor

Consider this wikicode:

http://>hostname</phpMyAdmin/

MediaWiki parses this as a plain text, but mwparserfromhell gives an invalid URL (http://) plus plain text (>hostname</phpMyAdmin/):

In [1]: import mwparserfromhell

In [2]: wikicode = mwparserfromhell.parse("http://>hostname</phpMyAdmin/")

In [3]: wikicode.nodes
Out[3]: ['http://', '>hostname</phpMyAdmin/']

In [4]: wikicode.filter_external_links()
Out[4]: ['http://']

In [5]: wikicode.filter_text(recursive=False)
Out[5]: ['>hostname</phpMyAdmin/']

I guess the parser should check if there is at least one valid character after http://...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant