You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use maplit::hashset;
let html = "<html><head>head content</head><body><div>test</div></body></html>";
let tags = hashset!["html", "head", "body"];
let mut b = ammonia::Builder::default();
b.add_tags(tags);
let clean_html = b.clean(html).to_string();
println!("{}", clean_html);
Output: head content<div>test</div>
Expectation: <html><head>head content</head><body><div>test</div></body></html>
Am I overlooking some setting?
The text was updated successfully, but these errors were encountered:
html, head, and body are more-or-less expected. The HTML is parsed as-if it was a div's innerHTML.
Does this mean that it is working as designed (I doubt that, due to the "more-or-less") or is there any plan to support such tags?
Imho it could be very useful. Right now passing a full fledged HTML doc to the library for sanitization is basically unsupported, since it would "break" the original doc.
Minimal example:
Output:
head content<div>test</div>
Expectation:
<html><head>head content</head><body><div>test</div></body></html>
Am I overlooking some setting?
The text was updated successfully, but these errors were encountered: