8000 'html', 'head' and 'body' tags are stripped out even if these are included in the whitelisted tags · Issue #183 · rust-ammonia/ammonia · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
'html', 'head' and 'body' tags are stripped out even if these are included in the whitelisted tags #183
Open
@Muntaner

Description

@Muntaner

Minimal example:

    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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0