Skip to content

how do I remove all the default allowed html and css tags ? #357

Answered by mganss
raksha-shanbhag asked this question in Q&A
Discussion options

You must be logged in to vote

Do you mean disallow all elements that are allowed by default?

var s = new HtmlSanitizer();
s.AllowedTags.Clear();
s.AllowedTags.Add("b");

This will allow only the <b> element and disallow all others.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@raksha-shanbhag
Comment options

@mganss
Comment options

Answer selected by raksha-shanbhag
Comment options

You must be logged in to vote
2 replies
@mganss
Comment options

@navidyazdi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants