Thank you, but I think we will keep our dependency on mwparserfromhell. Even though it has issues on Windows, it is way more powerful and reliable than any other wikicode parser in Python. And it does not only parse nested templates, but also wikilinks, external links and HTML tags.
Il 09/06/2014 10:49, Alex Brollo ha scritto:
While parsing wiki code without specific python tools, I found a major problem into templates code, since regex can't manage so well nested structures. I solved such issue by a layman approach with a parseTemplate routine, both in python and in javascript, which converts templates into a simple object (a dictionary + a list), coupled with another simple routine which rebuilds the template code from the original, or edited, object. The whole thing is - as I told - very rough and it has written for personal use only; but if anyone is interested about, please ask.
Alex brollo