Crates.io | strip-tags |
lib.rs | strip-tags |
version | 0.1.0 |
source | src |
created_at | 2024-08-31 17:45:18.566262 |
updated_at | 2024-08-31 17:45:18.566262 |
description | Strip HTML and PHP tags from strings |
homepage | https://github.com/LinusU/strip-tags-rs |
repository | https://github.com/LinusU/strip-tags-rs |
max_upload_size | |
id | 1359082 |
size | 13,746 |
A port of the strip_tags
function from PHP to Rust.
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!");
}
See documentation for more information.