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

strip_code() does not remove interwiki/in other language links #191

Closed
harej opened this issue Feb 25, 2018 · 1 comment
Closed

strip_code() does not remove interwiki/in other language links #191

harej opened this issue Feb 25, 2018 · 1 comment

Comments

@harej
Copy link

harej commented Feb 25, 2018

Test case is this bot user page on Hungarian Wikipedia: https://hu.wikipedia.org/wiki/Szerkeszt%C5%91:HerculeBot?action=raw

To reproduce:

import mwparserfromhell
import requests
r = requests.get('https://hu.wikipedia.org/wiki/Szerkeszt%C5%91:HerculeBot?action=raw').text
mwparserfromhell.parse(r).strip_code()

Actual behavior:

en:User:HerculeBot
ab:Алахәыла:HerculeBot
ace:Ureuëng Nguy:HerculeBot
af:Gebruiker:HerculeBot
ak:User:HerculeBot
als:Benutzer:HerculeBot
(and so on)

Expected behavior:
No content is returned, seeing as the page just consists of a template and many interwiki links meant to populate the "in other languages" menu and not the article body, and should therefore be filtered out by strip_code().

@earwig
Copy link
Owner

earwig commented Feb 26, 2018

This is the same underlying issue as #136, with many of the same difficulties. I'm going to merge it into that one.

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

No branches or pull requests

2 participants