use-html 0.0.1

Small HTML utility primitives for RustUse
Documentation
  • Coverage
  • 66.67%
    16 out of 24 items documented1 out of 16 items with examples
  • Size
  • Source code size: 14.69 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 543.11 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 30s Average build duration of successful builds.
  • all releases: 30s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Documentation
  • RustUse/use-web
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-html

Small HTML utility primitives for RustUse.

Experimental

use-html is experimental while the use-web workspace remains below 0.3.0. Expect small API adjustments during the first release wave.

Example

use use_html::{extract_links, extract_title, strip_tags_basic};

let html = "<html><head><title>Docs</title></head><body><a href=\"/guide\">Guide</a></body></html>";

assert_eq!(extract_title(html).as_deref(), Some("Docs"));
assert_eq!(extract_links(html)[0].href, "/guide");
assert_eq!(strip_tags_basic("<p>Hello <strong>world</strong></p>"), "Hello world");

Scope

  • Lightweight HTML detection and string-based extraction helpers.
  • Small helpers for links, headings, titles, meta tags, and attributes.
  • Basic escaping and unescaping for common entities.

Non-goals

  • Full HTML parsing.
  • DOM implementations.
  • Browser compatibility layers.
  • Sanitizers for security boundaries.

License

Licensed under either of the following, at your option:

  • Apache License, Version 2.0
  • MIT license