%p
%span foo
####
startrule : block(s?)
non_space : /[^ ]/
space : ' '
indent : space(s?)
indented_line : indent line
indented_lines : indented_line(s) level } @{$item[1]}) != $item[1][0]->level }>
block : indented_line block level <= $item[1]->level }>
| indented_lines
line : single_line | multiple_lines
single_line : line_head space line_body newline | line_head space(s?) newline | plain_text newline
# ALL subsequent lines ending in | are consumed
multiple_lines : line_head space line_body continuation_marker newline continuation_line(s)
continuation_marker : space(s) '|' space(s?)
continuation_line : space(s?) line_body continuation_marker
newline : "\n"
line_head : haml_comment | html_element
haml_comment : '-#'
html_element : '%' tag
# TODO: xhtml tags technically allow unicode
tag_start_char : /[:_a-z]/i
tag_char : /[-:_a-z.0-9]/i
tag : tag_start_char tag_char(s?)
line_body : /.*/
plain_text : backslash ('%' | '!' | '.' | '#' | '-' | '/' | '=' | '&' | ':' | '~') /.*/ | /.*/
backslash : '\\'
##
##
-# haml comment
%p a paragraph