aboutsummaryrefslogtreecommitdiff
path: root/grammars/html.bp
blob: 9ec33b6f48267e373df8822c80534d46e77076fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# HTML grammar
HTML: __ [doctype __] *html-element%__ __

doctype: "<!DOCTYPE" ..`>

html-element: void-element / raw-element / template-element / normal-element

void-element: `< ("area"/"base"/"br"/"col"/"embed"/"hr"/"img"/"input"/"link"/"meta"/"param"/"source"/"track"/"wbr") __attributes__ [`/] __ `>

template-element: "<template>"...("</template>") % (comment / html-element)

raw-element: `< @tag=("script"/"style"/"textarea"/"title") __attributes__ `>...("</"tag__`>)

normal-element: `< @tag=id __attributes__ `>...("</"tag`>) % (comment / html-element)

comment: "<!--" ..."-->"

attributes: *attribute%__
attribute: (+id%`:)__`=__ (id / `" ..`" / `' ..`')
attribute: (+id%`:)__`=__ (id / `" ..`" / `' ..`')