html_problems: Parse problems recorded for a document

View source: R/parse.R

html_problemsR Documentation

Parse problems recorded for a document

Description

HTML parsing never fails on malformed markup: the parser repairs it as a browser would. html_problems() lists what was repaired, which is useful for diagnosing why a tree looks the way it does. Real pages nearly always have some. This is not a conformance validator.

Usage

html_problems(x)

Arguments

x

A zuhtml_document, or a zuhtml_nodeset for the document that owns it.

Value

A data frame with one row per problem, in input order, and columns stage ("tokenizer" or "parser"), code (a stable package-owned name, such as "unexpected-end-tag" or "duplicate-attr"), line and column (1-based) and byte_offset (0-based, into the decoded UTF-8 input). At most max_errors problems are kept (see html_limits()); attribute "truncated" is TRUE when more occurred.

See Also

Other parsing: html_fragment(), html_info(), html_limits(), html_parse(), zuhtml_info()

Examples

doc <- html_parse("<p>One</div><p id=a id=b>Two")
html_problems(doc)

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