Skip to content

forme 0.12.0

Latest

Choose a tag to compare

@mgilbir mgilbir released this 28 Oct 10:48
e133f71

Compose reports what a document says about itself, so a backend can fill a
file's metadata without parsing the HTML a second time. From PR #962.

Document metadata (layout, #962):

  • Composed.Document is a DocumentInfo, read from the parse Compose already
    did and set whether or not the document was refused.
  • Title and HasTitle are document.title: the first title element's text,
    with ASCII whitespace stripped and collapsed. HasTitle tells a document
    with no title from one whose title is empty.
  • Language and HasLanguage are the root element's language, by the rule
    layout hyphenates, cases and matches :lang() by: lang, xml:lang in
    XHTML, then a Content-Language pragma. HasLanguage tells lang="" from
    no declaration.
  • Direction is the root's dir: "ltr", "rtl", or empty.
  • Meta is every in the head, in document order, with
    the name lowercased and the element's Source. It stops at 256 entries,
    with a limit finding.
  • Values are the document's after HTML's own normalisation; validating a
    language tag or cutting a title is the backend's job.

Verified on main at e133f71: CI green in all three jobs, the reftest
ratchet at 5996 of 6253, and the API changes since v0.11.0 additions only.