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

filter_wikilinks does not work for links with added suffixes #82

Open
djstrong opened this issue Jul 28, 2014 · 4 comments
Open

filter_wikilinks does not work for links with added suffixes #82

djstrong opened this issue Jul 28, 2014 · 4 comments

Comments

@djstrong
Copy link

For wikicode [[link]]s filter_wikilinks returns [[link]] - it should [[link]]s or [[link|links]].

@earwig earwig added this to the version 0.4 milestone Jul 29, 2014
@earwig earwig self-assigned this Jul 29, 2014
@ricordisamoa
Copy link
Contributor

The link trail depends on the language. For example, the one on the English Wikipedia is different from the Ukrainian one.
The filter_wikilinks method should maybe accept the link trail as an argument, otherwise no trail would be recognized.

@earwig
Copy link
Owner

earwig commented Dec 25, 2014

filter_wikilinks doesn't do any actual work, it just navigates the tree. This would have to be an argument to mwparserfromhell.parse... I'm really uncomfortable about adding site-specific arguments like this to that function. Maybe we should consider the current behavior correct?

@djstrong
Copy link
Author

I think that extracting links with anchor text is basic function, so should be included.

@ricordisamoa
Copy link
Contributor

@earwig you're right, the link trail would have to be passed to mwparserfromhell.parse.
The maintainability of the parser shouldn't be affected as long as it does not implement any site-specific logic. The link trail is a standard MediaWiki feature, and anyway it would be up to the mwparserfromhell users (or to the maintainers of complementary frameworks such as Pywikibot) to pass the appropriate link trail to the parser.

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

3 participants