Skip to content

zuhtml

0.1.0Package record

Parse 'HTML' with a Bundled 'Gumbo' Parser

0packages depend
264downloads / year
77.0%test coverage
13/13flavors OK

Overview

About

Parses real-world 'HTML' with a bundled copy of the 'Gumbo' parser (https://codeberg.org/gumbo-parser/gumbo-parser), which follows the 'WHATWG' parsing algorithm, so that no system library is required. Documents become immutable trees navigated with a documented subset of 'CSS' selectors. Attributes, text, lists, tables, links, forms and page metadata ('JSON-LD', microdata) are extracted into ordinary character vectors, lists and data frames, and nodes convert to 'Markdown'. Input is a string, raw bytes, a file, a URL or a connection, and raw input is decoded as browsers decode it, from a byte-order mark or a '<meta>' declaration. Parsing is bounded by limits on input size, native memory and nesting depth.

Changes in 0.1.0

First release.

  • Bundles the 'Gumbo' HTML5 parser 0.14.0 from the maintained fork at <https://codeberg.org/gumbo-parser/gumbo-parser>, with local patches that add a parse-time nesting-depth limit, remove the library's only printf(), and fix two memory-safety bugs in its <selectedcontent> support that fuzzing found (a use-after-free and a NULL dereference, both reachable from untrusted HTML) and an uninitialized read in fragment parsing. No system library is needed.
  • New html_parse() and html_read() parse HTML from a string, raw vector or local file under explicit resource limits from the new html_limits(). Nesting depth is bounded while parsing, and all parser memory goes through an allocation ledger with a budget, so a failed parse always releases everything. Raw input is decoded from a byte-order mark, an explicit encoding, the page's <meta> declaration or UTF-8; invalid input is an error, never silently replaced.
Show all changes in 0.1.0Hide the rest of the changes in 0.1.0
  • Parsed documents are converted into a compact immutable tree that holds no reference to the parser or the input. All 1,686 applicable html5lib tree-construction tests that the bundled parser ships produce the expected tree.
  • New html_fragment() parses markup in the context of a given element, as innerHTML does.
  • Nodes are zuhtml_nodesets: vectors of nodes tied to their document, with missing nodes where an aligned operation has no answer. Navigate with html_children(), html_parent(), html_ancestors(), html_next_sibling(), html_previous_sibling(), html_root(), html_document() and html_template_content(); read values with html_name(), html_namespace(), html_type(), html_attr(), html_attrs(), html_classes() and html_text(). html_info() describes a document. lapply() and friends over a nodeset pass one node at a time; rep(), rev(), unique() and c() keep nodesets nodesets.
  • New extraction functions. html_text_clean() gives text as a reader wants it: scripts and styles skipped, whitespace collapsed outside <pre>, line breaks at <br> and block elements. html_list() reads a <ul>/<ol> as text or a tree, without nested items leaking into their parents. html_table() and html_tables() read tables into data frames of character columns, with row and column spans, rowspan="0", row groups, header detection and an error rather than a silent overwrite for overlapping cells. html_url() resolves URL attributes with RFC 3986 reference resolution, honouring <base href>, and html_links() lists a page's links.
  • New html_elements(), html_element(), html_matches() and html_filter() select elements with a documented subset of CSS selectors: type, universal, ID, class and attribute selectors (with the i and s flags), the four combinators, selector lists, :scope, :root, :empty, :first-child, :last-child, :only-child, :nth-child(), :nth-of-type() and :not(). Anything else is a zuhtml_selector_error pointing at the offending position. html_element() keeps one result per input node, so extracted columns stay aligned.
  • New html_closest() finds each node's nearest ancestor matching a selector, and html_strings() returns the text pieces html_text() joins, keeping element boundaries. html_serialize(pretty = TRUE) lays block-level elements out on indented lines for reading.
  • New html_title(), html_meta(), html_json_ld() and html_microdata() read page metadata: the document title, every <meta> tag (OpenGraph, Twitter cards and Dublin Core included), JSON-LD blocks (parsed with jsonlite if asked) and microdata items per the HTML standard, itemref included.
  • New html_table_cells() returns one row per table cell with its grid position, spans, section, whether it is a header, and its links. html_tables() gains match = to keep tables whose text matches a regular expression. html_table() gains convert =, decimal = and thousands = to convert columns that are entirely numbers or logicals, keeping identifiers with leading zeros as text.
  • New html_markdown() converts nodes to CommonMark: headings, paragraphs, emphasis, code, fenced code blocks, block quotes, nested lists, links and images with resolved URLs, and GFM pipe tables for data tables. Markdown-significant characters in text are escaped, and only emphasis that CommonMark parses back is written.
  • The <meta> declaration of raw input is found as browsers find it, by the HTML standard's prescan of the first 1024 bytes, and read with the Encoding Standard's labels (so iso-8859-1 means windows-1252). html_info() reports where the encoding came from in encoding_source.
  • New html_forms() describes each form and the controls it owns, by the HTML standard's form-owner rules (form= references included), with DOM values for every control type and the options of each select. It only inspects: nothing is submitted.
  • html_read() reads a URL (through base R's url(), which also sets the default base_url) or any connection, such as gzfile(), as well as a file path. Reading stops once the input passes four times max_input.
  • New html_serialize() (and as.character() on nodesets) writes nodes as normalized HTML following the WHATWG serialization algorithm, outer or inner.
  • New html_problems() lists the parse errors the parser repaired, with package-owned codes and positions.
  • Errors are classed conditions under zuhtml_error; see ?zuhtml-conditions.
  • New zuhtml_info() reports the bundled parser version and patches, and self-tests the compiled parser.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 3.0 min · r-devel-windows-x86_64
Status changes
  • OK13 OKNow
  • OK6 OK2026-10-07
Advisories

none known

Documentation

In release 0.1.0
READMEYes · 317 wordsVignettesYes · 4 · dynamicNEWSYes · 67% structured · mentions 0.1.0Citation fileNoWebsiteYes · pkgdown

The repository also keeps web-only articles.

Help pages
28 (1 internal)includes a package overview page
Examples that run
100%26 run in a plain check
Exported functions with examples
100%
Documented parameters
100%
Return-value docs
100%
Help pages citing references
0%

Downloads

264
CRAN downloads in the past year
Rank #25,387 · ~1/day · ~22/mo
zuhtml
Daily download trend is not available in this view yet.
26430 days
26490 days
2641 year
Compare downloads with other packages →

Repository

0Stars
0Forks
3Open issues
0Open PRs
1Releases
80Commits
2Commit identities
80 commits · Last activity 2026-10-13 · Default branch at 0.1.0.9000, ahead of CRAN 0.1.0 (checked 2026-10-18)
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
0
Median days to close, 50 most recently updated closed PRs
0

Releases over time

2026-10-07 · 02026-10-10 · 1
PracticesBeta

7 development-tooling and community-health practices detected across 4 families in the upstream repository

Checks run against github.com/pedrobtz/zuhtml on 2026-10-18.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux

Docs source (3)
pkgdown

GitHub Pages site last deployed 2026-10-13 · The repository has a site deploy workflow

pkgdown site last built 2026-10-13

CRAN release process (1)
cran-comments.md
Git structural (1)
.gitattributes
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-09-24
    Seen in the repository: CLAUDE.md
    Named in .Rbuildignore: CLAUDE.md
    Pull request it wrote: opened by a project member
    Commits: at least 34 crediting it in the message
Shared conventions any agent may read, so they name no particular tool.
Seen in the repository: .agents
Models named in its commits
  • Claude Opus 5.533 commits · Sep to Oct 2026
  • Claude Fable 5.11 commit · Sep 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
5 external dependencies (excludes base and recommended)

Installing zuhtml adds no packages beyond those that come with R.

Depends (1)
R >= 4.1
Imports (0)
none
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (3)
Author, Maintainer since 0.1.0 (2026), Copyright holder
Copyright holder
Gumbo, bundled in src/vendor/gumbo
Copyright holder
UTF-8 decoder in src/vendor/gumbo/utf8.c
Releases (1)
  • 0.1.0Latest
    2026-10-06 · current release ·
    2 days in CRAN's queue
    Listed in CRAN's incoming queue from 2026-10-03 21:57 to 2026-10-06 08:22 UTC, in 12 readings.
  • R
    R 4.6.0 released · 2026-04-24
Across CRAN, the median accepted release of the past year spent 26 hours in the queue, 90% under 11 days.How queue time is measured

Package metadata

First published
2026-10-06
Total releases
1 / 1 yrs
License
MIT + file LICENSE OSI
Copyright
See inst/COPYRIGHTS in the package
Minimum R
≥ 4.1
Download size
323 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("zuhtml")
Baltazar, P., Google Inc., & Hoehrmann, B. (2026). zuhtml: Parse 'HTML' with a Bundled 'Gumbo' Parser (Version 0.1.0) [Computer software]. https://doi.org/10.32614/CRAN.package.zuhtml

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for zuhtml version 0.1.0 [Data set]. HJJB, LLC. Data release v2026-10-22. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy