-Paragraph ::= { "\"\"" ws text } => "blockquote"
- > { "*" " " ws text } => "ul"
- > { "#" " " ws text } => "ol"
- > { num " " ws text } => "ol"
- > { "---" "-"* } => "hr"
- > { text } => "p"
-
-text ::= item */ ws
-pre ::= "[verbatim]" { [~]+ } /ws => "verbatim" // FIXME doesn't work
-item ::= pre
- > email
- > structured
- > styled
- > "\"" text "\"" => quoted
- > [a-zA-Z0-9]++
- > symbol
-
-symbol ::= symbolx & sym++
-symbolx ::= "--" => emdash
- | ","
- | ":"
- | ";"
-
-styled ::= "**" text "**" => bold
- | "__" text "__" => ul
- | "~~" text "~~" => it // hard to type
- | "((" text "))" => footnote
-
-structured ::= glyph
-// | url
-
-glyph ::= "(r)" | "(c)" | "(tm)" // euro symbol?
+Paragraph ::= { "\"\"" ws text } => "blockquote"
+ > { "---" "-"* } => "hr"
+ > { text } => "p"
+
+onums !::= nums (". "|") ")
+any !::= ~[]*
+
+uli ::= "* " (ws text &~ any (oli|uli)) => "li"
+oli ::= ("# "|onums) (ws text &~ any (oli|uli)) => "li"
+
+text ::= Item => text
+Itemx ::= ws Item
+ | ()
+Item ::= blockquote
+ > { uli+/ws => "ul" } Itemx => []
+ | { oli+/ws => "ol" } Itemx => []
+ > pre Itemx => []
+ > structured Itemx => []
+ > structuredx Itemx => []
+ > styled Itemx => []
+ > qtext Itemx => []
+ > (alphanum++ => stringify) Itemx => []
+ > symbol Itemx => []
+ > (sym++ => stringify) Itemx => []
+ > Paragraph Itemx => []
+
+blockquote ::= "\"\"" text "\"\"" => "blockquote"
+ | "\"\"" block => "blockquote"
+
+qtext ::= "\"" text "\"" => "quoted"
+pre ::= "[verbatim]" { ~[]+ } /ws => "verbatim" // FIXME doesn't work
+
+styled ::= "__" text "__" => underline
+ | "((" text "))" => footnote
+ | ( "[[" text "]]" => tt
+ > "[" word "]" => citation
+ )
+ | "!!" text "!!" => strikethrough
+ | "^^" (word|block) => superscript
+ | ",," (word|block) => subscript
+ | "\\sc" block => smallcap
+ | "**" text "**" => bold
+ | "!" (word|block) => keyword
+ > "*" text "*" => it
+
+block ::= { text }
+structured ::= { text } "->" (url|email) => link
+ //> alphanum++ "->" (url|email) => link
+structuredx ::= glyph
+ > email
+ > url
+
+glyph ::= "(r)" | "(c)" | "(tm)" | "--" // euro symbol?
+ | "\\today" -> ~[a-z] => today