import Base import ./dom.bend as Dom import ./tokenize.bend as Tk # HTML tree construction, after the WHATWG algorithm (HTML section 13.2.6), # reduced to what server-rendered pages need. Every input parses: there is no # "malformed HTML" error, only repairs, as in browsers. # # - html, head and body are implied. Head elements (meta, link, title, style, # script, base, noscript, template) before any body content go to . # - Void elements (br, img, input, meta, link, hr, ...) never take children. # - Implied end tags: a block start closes an open

;

  • closes an open #
  • (up to its list);
    /
    close each other; a heading closes an # open heading;