On 11/13/07, Virgil Ierubino <virgil.ierubino(a)gmail.com> wrote:
This is not true. It is not arbitrary what symbol come before the last
one.
Each symbol defines a list-type, and it's not only the final list-type
that
counts. A string of symbols beginning with an asterisk will output a
nested
list beginning with a bullet point - a string beginning with a hash will
output a list beginning with a number.
It's arbitrary in the sense that every combination is valid.
This text:
* foo
#*#*#*#*#***#*###*# bloo
* foo
may be odd, but it's valid and can be rendered.
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!
If you like, my solution could be considered a minimal departure from a
straight EBNF-based parser. EBNF will come very close to parsing and
treating it correctly, as follows:
<list-item> ::= <bullet-item> | <enumerated-item> |
<indented-item>
<bullet-item> ::= "*" (<list-item> | <text>)
<enumerated-item> ::= "#" (<list-item> | <text>)
<indented-item> ::= ":" (<list-item> | <text>)
Then just a tiny bit of cleanup later on :)
Steve