Repository navigation
|
Hello!!! Example:Input html: Output:(Values of elements) Output keeping the capitalization:(Values of elements) |
Replies: 2 comments
|
|
|
This is a deal-breaker for me, as I'm trying to manipulate Leptos and Ember style fragments that are component references such as // Parse
let mut document = Html::parse_fragment(&body);
let tree = HtmlTreeSink::new(document);
// Mutate
// TODO perform transformations
// Finalize
let document = tree.finish();
let body = document.html();But this library is not safe for dom manipulation if it's going to perform its own arbitrary transformations. |
scraper::CaseSensitivityis used byElement::has_idandElement::has_classwhen checking if an element contains a specific id or class so it's not related to what you get as element values. That depends on HTML serialization and, as element tag names are case insensitive (see https://w3c.github.io/html-reference/documents.html), I think you should avoid treating them as case sensitive