Sorry if this is already possible, but I don't think it is: I'd like to be able to use attribute_filter, or something like it, in order to set a different attrB using (or not) the value from the attrA that was present and found by the filter (attrB may or may not exist already).
For example it might look something like:
use ammonia::Builder;
let a = Builder::new()
.attribute_filter(|element, attribute, value| {
match (element, attribute) {
("a", "href") => Some(hashset![("href", value), ("title", value)]),
_ => None
}
})
Sorry if this is already possible, but I don't think it is: I'd like to be able to use
attribute_filter
, or something like it, in order to set a differentattrB
using (or not) the value from theattrA
that was present and found by the filter (attrB
may or may not exist already).For example it might look something like: