Pedro Fayolle schrieb:
Hi,
I've been coding a wiki parser in JavaScript with the hope it could be of some use for the project (especially in giving some relief to the servers).
You can view a demo here: http://gusanos.sourceforge.net/wp/wikitest.htm
This works very well, but is it really a *parser* or "just" a *converter*? Don't get me wrong, I fell for the same thing at least twice :-)
Timwi and I (well, mostly Timwi) have been working on a *parser* wiki-to-XML, written in Bison, a parser-generator language that outputs C code. It is already pretty advanced (HTML parsing is currently kinda broken, though), and having an XML file as output beats wiki-to-HTML, as it can be converted into (X)HTML just as easily (relatively speaking;-) as into PDF, OpenOffice XML, RDF, or something else entirely (even back into wiki text, as a markup beautifier!).
So, if you've written a converter, well, great, but I wrote at least three of them in C++, and abandoned them all in different stages of development (at least one should do most of yours, including TOCs). Language flamewars aside, I think exchanging the current PHP converter for another is such a complex task (talking integration in the existing framework) that "merly" improving conversion speed might not be worth the effort.
If, however, you've written a "real" parser, it would be most interesting to know if it could produce XML instead.
Anyway, you might like to look at the Bison code of Timwis parser, in the CVS, module "flexbisonparse". You can try it with the CVS HEAD wikipedia, if you follow the instructions in "ParserXML.php", in case you're interested.
Magnus