PureHTML. TreeBuilder. Modes. InCaption
(PureHTML v0.5.0)
View Source
HTML5 "in caption" insertion mode.
This mode handles content inside a <caption> element within a table.
Per HTML5 spec:
- Character tokens: process using "in body" rules
- Comments: process using "in body" rules
- DOCTYPE: parse error, ignore
- Start tags:
- caption, col, colgroup, tbody, td, tfoot, th, thead, tr: close caption, reprocess
- Anything else: process using "in body" rules
- End tags:
- caption: close caption, switch to "in table"
- table: parse error, close caption, reprocess
- body, col, colgroup, html, tbody, td, tfoot, th, thead, tr: parse error, ignore
- Anything else: process using "in body" rules
See: https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-incaption