html_title: Document title

View source: R/metadata.R

html_titleR Documentation

Document title

Description

The document's title as the HTML standard defines document.title: the text of the first ⁠<title>⁠ element in the HTML namespace, with leading and trailing whitespace removed and runs of whitespace collapsed to one space. An SVG ⁠<title>⁠ does not count.

Usage

html_title(x)

Arguments

x

A zuhtml_document, or a zuhtml_nodeset whose document is used.

Value

A single string, NA when the document has no ⁠<title>⁠.

See Also

Other metadata: html_json_ld(), html_meta(), html_microdata()

Examples

html_title(html_parse("<title>  Annual\n  report </title><p>Body"))
html_title(html_parse("<p>No title"))

zuhtml documentation built on Oct. 6, 2026, 5:06 p.m.