On Tue, Nov 13, 2007 at 05:59:59PM +0000, Thomas Dalton wrote:
I think toggles is the only way to do it, although even then it's hard since the result isn't going to be a tree.
The only alternative I can think of is running the wikitext through a tidier first that detects that kind of mess and adds the appropriate close and reopen tags. It requires an extra pass through the text, but might be unavoidable. Basically, we accept that wikitext can't be described by EBNF, so start by parsing the wikitext into a more restrictive form of wikitext which can be described by EBNF, and then parsing that. It's a mess, but it's probably better than what we have at the moment.
Note that this totally screws the people who are hoping for a clean WT-XML parser.
Cheers, -- jra