Skip to content

v0.7.0 — inner HTML, --has-text, browser-style text

Choose a tag to compare

@github-actions github-actions released this 26 Jul 08:04
· 19 commits to main since this release

Three features in this release, and every one of them answers a long-open feature request on htmlq's issue tracker (mgdm/htmlq #75, #55, #74):

Added

  • -i / --inner — print inner HTML: children only, no outer tag. Composes with -p (pretty) and --color.
    $ cull '#readme' -i page.html
  • --has-text STRING — keep only matches whose text content contains STRING. Repeatable (all strings must be present); runs before -1/-c/-l, so counts and file lists reflect the filter. Needles match across inline-tag boundaries (--has-text 'price: 42' matches price: <b>42</b>).
    $ cull 'tr' --has-text FAILED -t report.html

Changed

  • -t / --text now lays text out the way a browser would (innerText-style): <br> and block-element boundaries become newlines, <pre>/<textarea> stay verbatim, script/style/template are skipped, inline whitespace still collapses. Previously block boundaries were dropped entirely (<div>x<p>y</p></div>xy; now xy). Single-line values in -j templates and --table cells are unchanged.

16 new tests (119 total). The playground runs 0.7.0.

Install: curl -fsSL https://raw.githubusercontent.com/rashida-thorne/cull/main/scripts/install.sh | sh · brew install rashida-thorne/cull/cull · cargo binstall cull · scoop bucket add cull https://github.com/rashida-thorne/scoop-cull && scoop install cull · nix run github:rashida-thorne/cull · docker run ghcr.io/rashida-thorne/cull

Full changelog: https://github.com/rashida-thorne/cull/blob/main/CHANGELOG.md