Jakub Klinkovský

Results 378 comments of Jakub Klinkovský

Obviously at least `` behaves the same as `` here and who knows how each extension tag behaves. There might also be other inconsistencies we haven't found yet.

When you work with [sys.argv](https://docs.python.org/3/library/sys.html#sys.argv), the program arguments are actually 1-indexed (`sys.argv[0]` is reserved for the program name). Is it annoying? Maybe, but much more important is Python's consistence with...

There is a more general issue with the abstract tree traversal and replacement (with an empty string in your case) - see #195.

I'm working on this for my [wiki-scripts](https://github.com/lahwaacz/wiki-scripts/) project - see the [ws.parser_helpers.template_expansion](https://github.com/lahwaacz/wiki-scripts/blob/master/ws/parser_helpers/template_expansion.py) module and the accompanying [tests](https://github.com/lahwaacz/wiki-scripts/blob/master/tests/parser_helpers/test_template_expansion.py). The main function, `expand_templates`, takes a content-getter callback function which should return the...

Mapping MediaWiki template parameters to key-value pairs like in Python dicts is difficult, because there may be multiple parameters with the same key.

Got some progress with custom `ifilter`-like functions. First attempt: ```python def indexed_ifilter(wikicode, recursive=True, matches=None, flags=FLAGS, forcetype=None): """Iterate over nodes and their corresponding indices and parents. The arguments are interpreted as...

What's the use case for such context-sensitive code stripping? There are many more similar problems: should category and interlanguage links be stripped too? And I don't even have to start...

Why namespace numbers? There are no namespace numbers in the language, only in the database, which is not touched at all by mwparserfromhell. Even though the common namespace numbers are...

Your variable `w` is not a string (`str`), but a `Wikicode` object. Its `replace` method (documented [here](https://mwparserfromhell.readthedocs.io/en/latest/api/mwparserfromhell.html#mwparserfromhell.wikicode.Wikicode.replace)) works differently than `str.replace`, the `ValueError` exception is raised regardless of the parameter...

Note that [str.replace](https://docs.python.org/3/library/stdtypes.html?highlight=str.replace#str.replace) returns a _copy_ of the string instead of changing the instance. `Wikicode.replace` will most likely never do this, so there will always be some difference.