html_to_json
Convert an HTML fragment into a structured JSON tree.
Syntax
{{ value | html_to_json }}Example
Basic usage
1{2 "html": "<p>Hello</p>"3}1{{ html | html_to_json }}1{"type":"element","tag":"p","children":[{"type":"text","content":"Hello"}]}Behavior
- Requires browser-compatible DOM globals and the knap/html preset.