Expand description
HTML adapter for Quarb.
Maps an HTML document onto the arbor model, parsing with
html5ever (via scraper) so malformed markup is handled per the
HTML5 standard.
- Elements are the nodes; text and comment nodes are not navigated (text is exposed as a projection instead).
- A node’s name is its tag (
html,body,div,h1,a), so/html/body//pnavigates by element type. The document root is unnamed; the<html>element is its single child. - A node’s traits are structural classes:
<block>or<inline>, plus<heading>forh1–h6and<link>for an anchor with anhref. - Attributes are properties:
::href,::class,::id. The default projection (::) and::textare the element’s text content;;;;tag,;;;id,;;;classes, and any;;;attrexpose metadata. - An anchor’s fragment
hrefresolves:::href~>follows#sectionto the element withid="section".
Structs§
- Html
Adapter - A Quarb adapter over a parsed HTML document.