You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, mwparserfromhell treats everything that looks like a XML tag as one, regardless of whether MediaWiki recognizes it or not. The same applies to wikilinks and file links. That makes sense since mph has no way to know what MW would do, but what if we provide necessary information as arguments to the Parser constructor?
For example:
# Namespaces taken from ptwiki, a wiki whose language has grammatical gender.parser=Parser(
recognized_tags= ['categorytree', 'charinsert', ...] # Or any kind of Iterable[str],namespaces= { # Or any kind of Mapping[int, str | Iterable[str]]0: '',
1: 'Discussão',
2: ['Usuário', 'Usuária', 'Usuário(a)'],
...: ...
}
)
Namespace 0 would have a default value of '' (I'm not sure if MediaWiki allows configuring namespace prefix for this one or not). A non-recognized namespace would be considered to be a page in namespace 0 if that has no prefix, or cause an exception otherwise.
The text was updated successfully, but these errors were encountered:
Currently I don't see an option for this.
By default, mwparserfromhell treats everything that looks like a XML tag as one, regardless of whether MediaWiki recognizes it or not. The same applies to wikilinks and file links. That makes sense since mph has no way to know what MW would do, but what if we provide necessary information as arguments to the
Parser
constructor?For example:
Namespace 0 would have a default value of
''
(I'm not sure if MediaWiki allows configuring namespace prefix for this one or not). A non-recognized namespace would be considered to be a page in namespace 0 if that has no prefix, or cause an exception otherwise.The text was updated successfully, but these errors were encountered: