On 13/11/2007, Steve Bennett <stevagewp(a)gmail.com> wrote:
I think there's a pretty simple solution.
Given some input:
*a
*#b
*#c
***d
*##e
First, naively turn *a into <ul><li>a</li></ul> etc on a line by
line
basis:
<ul><li>a</li></ul>
<ul><ol><li>b</li></ol></ul>
<ul><ol><li>c</li></ol></ul>
<ul><ul><ul><li>d</li></ul></ul></ul>
<ul><ol><ol><li>e</li></ol></ol></ul>
This can be done with a BNF-based parser, I think.
Then, simply repeatedly collapse adjacent pairs of </ul><ul> and
</ol><ol>
We already know there is a solution to the problem of "converting Wikitext
into XHTML" - which is what you solve here. We already do it! The problem I
am claiming is impossible to solve is that of *expressing Wikitext in EBNF".
Whilst this is true, as you point out, it may not be a problem as long as we
use a quirky parser that understands this quirk.
If we do manage to circumvent this problem of lists, then I am fairly
confident that we DO in fact already have a complete expression of Wikitext
in EBNF - to my knowledge this was the only major barrier. So imagining we
do have this solution, what's next?