(24 lines)
1 # Syntax definitions for some HTML-specific patterns2 #3 # NOTE: this is *NOT* intended to be a complete definition of the language's4 # syntax! Providing a full language grammar is overkill, because the intended5 # use case is finding/replacing string patterns. This task does not require a6 # full parse tree, and having one makes the task considerably more complicated.7 # See the accompanying README.md for more info.9 doctype: "<!DOCTYPE" ..%\n `>11 element: void-element / raw-element / template-element / normal-element13 void-element: `< ("area"/"base"/"br"/"col"/"embed"/"hr"/"img"/"input"/"link"/"meta"/"param"/"source"/"track"/"wbr") __attributes__ [`/] __ `>15 template-element: "<template>" ..%(\n / comment / element) "</template>"17 raw-element: `< @tag:("script"/"style"/"textarea"/"title") __attributes__ `> ..%\n ("</"tag__`>)19 normal-element: `< @tag:id __attributes__ `> ..%(\n / comment / element) ("</"tag__`>)21 comment: "<!--" ..%\n "-->"23 attributes: *attribute%__24 attribute: (+id%`:)__`=__ (id / string)