#php

no-std strip-tags

Strip HTML and PHP tags from strings

1 unstable release

0.1.0 Aug 31, 2024

#562 in Text processing

MIT license

14KB
349 lines

Strip Tags

A port of the strip_tags function from PHP to Rust.

Usage

use strip_tags::strip_tags;

fn main() {
    let html = "<p>Hello, <strong>world</strong>!</p>";
    let text = strip_tags(html);
    assert_eq!(text, "Hello, world!");
}

API

See documentation for more information.

No runtime deps