Sanitizer Class
https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#sanitizer
public sealed class SanitizerConstructors
| Name | Description |
|---|---|
| Sanitizer(SanitizerConfigOrSanitizerPresets?) | https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizer-sanitizer |
Sanitizer(SanitizerConfigOrSanitizerPresets?)
Sanitizer.cshttps://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizer-sanitizer
public Sanitizer(SanitizerConfigOrSanitizerPresets? configuration = null)Parameters
configurationSanitizerConfigOrSanitizerPresets?- The configuration, or null for the built-in safe default configuration ("default").
See also
Methods
| Name | Description |
|---|---|
| AllowAttribute(SanitizerAttribute) | Adds an attribute to the allow list of the configuration; returns whether the configuration changed. |
| AllowElement(SanitizerElementWithAttributes) | Adds an element to the allow list of the configuration; returns whether the configuration changed. |
| AllowProcessingInstruction(SanitizerPI) | Adds a processing instruction to the allow list of the configuration; returns whether the configuration changed. |
| Get() | https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizer-get |
| RemoveAttribute(SanitizerAttribute) | Adds an attribute to the remove list of the configuration; returns whether the configuration changed. |
| RemoveElement(SanitizerElement) | Adds an element to the remove list of the configuration; returns whether the configuration changed. |
| RemoveProcessingInstruction(SanitizerPI) | Adds a processing instruction to the remove list of the configuration; returns whether the configuration changed. |
| RemoveUnsafe() | https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizer-removeunsafe |
| ReplaceElementWithChildren(SanitizerElement) | Adds an element to the list of elements replaced with their children; returns whether the configuration changed. |
| SetComments(bool) | Sets whether comments are allowed; returns whether the configuration changed. |
| SetDataAttributes(bool) | Sets whether custom data-* attributes are allowed; returns whether the configuration changed. |
| SetJavaScriptUrls(bool) | Sets whether javascript: URLs are allowed; returns whether the configuration changed. |
AllowAttribute(SanitizerAttribute)
Sanitizer.csAdds an attribute to the allow list of the configuration; returns whether the configuration changed.
public bool AllowAttribute(SanitizerAttribute attribute)AllowElement(SanitizerElementWithAttributes)
Sanitizer.csAdds an element to the allow list of the configuration; returns whether the configuration changed.
public bool AllowElement(SanitizerElementWithAttributes element)AllowProcessingInstruction(SanitizerPI)
Sanitizer.csAdds a processing instruction to the allow list of the configuration; returns whether the configuration changed.
public bool AllowProcessingInstruction(SanitizerPI pi)Get()
Sanitizer.cshttps://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizer-get
public SanitizerConfig Get()RemoveAttribute(SanitizerAttribute)
Sanitizer.csAdds an attribute to the remove list of the configuration; returns whether the configuration changed.
public bool RemoveAttribute(SanitizerAttribute attribute)RemoveElement(SanitizerElement)
Sanitizer.csAdds an element to the remove list of the configuration; returns whether the configuration changed.
public bool RemoveElement(SanitizerElement element)RemoveProcessingInstruction(SanitizerPI)
Sanitizer.csAdds a processing instruction to the remove list of the configuration; returns whether the configuration changed.
public bool RemoveProcessingInstruction(SanitizerPI pi)RemoveUnsafe()
Sanitizer.cshttps://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-sanitizer-removeunsafe
public bool RemoveUnsafe()ReplaceElementWithChildren(SanitizerElement)
Sanitizer.csAdds an element to the list of elements replaced with their children; returns whether the configuration changed.
public bool ReplaceElementWithChildren(SanitizerElement element)SetComments(bool)
Sanitizer.csSets whether comments are allowed; returns whether the configuration changed.
SetDataAttributes(bool)
Sanitizer.csSets whether custom data-* attributes are allowed; returns whether the configuration changed.
SetJavaScriptUrls(bool)
Sanitizer.csSets whether javascript: URLs are allowed; returns whether the configuration changed.