Make Wikicode.matches() handle namespaces.#335
Open
roysmith wants to merge 2 commits intoearwig:mainfrom
Open
Conversation
lahwaacz
reviewed
Jan 10, 2025
|
|
||
| If either side has any colons, everything before the last colon is taken to be | ||
| a namespace and/or interwiki prefix. The parts before and after the colon are | ||
| normalized and compared separately; both must match for the result to be True. |
Contributor
There was a problem hiding this comment.
This does not make sense - if something is not a valid namespace/interwiki prefix, it should not be normalized.
Author
|
OK, I've just spent some time reading https://www.mediawiki.org/wiki/Manual:Page_title and have come to the realization that this (as with so many things about MediaWiki) is way more complicated than I originally thought. So, one possibility would be to have matches() optionally accept something like a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wikicode.matches() currently does not handle page names with namespaces and/or interwiki links. This makes them do so.
Fixes #302.