Class HtmlFilter
Simple HTML sanitizer to remove unsafe constructs.
Inheritance
System.Object
HtmlFilter
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.HtmlParsing
Assembly: EPiServer.Framework.dll
Version: 11.20.7Syntax
public class HtmlFilter
Constructors
HtmlFilter()
Initializes a new instance of the HtmlFilter class.
Declaration
public HtmlFilter()
HtmlFilter(IFilterRules)
Initializes a new instance of the HtmlFilter class.
Declaration
public HtmlFilter(IFilterRules rules)
Parameters
Type | Name | Description |
---|---|---|
IFilterRules | rules | The rules. |
HtmlFilter(ParserOptions)
Initializes a new instance of the HtmlFilter class.
Declaration
public HtmlFilter(ParserOptions options)
Parameters
Type | Name | Description |
---|---|---|
ParserOptions | options | The options. |
HtmlFilter(ParserOptions, IFilterRules)
Initializes a new instance of the HtmlFilter class.
Declaration
public HtmlFilter(ParserOptions options, IFilterRules rules)
Parameters
Type | Name | Description |
---|---|---|
ParserOptions | options | The options. |
IFilterRules | rules | The rules. |
Methods
FilterAttributes(FilterContext, AttributeCollection)
Declaration
protected bool FilterAttributes(FilterContext context, AttributeCollection attributes)
Parameters
Type | Name | Description |
---|---|---|
FilterContext | context | |
AttributeCollection | attributes |
Returns
Type | Description |
---|---|
System.Boolean |
FilterHtml(TextReader, TextWriter)
Filters the HTML from input and writes it to the output.
Declaration
public void FilterHtml(TextReader input, TextWriter output)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextReader | input | The input. |
System.IO.TextWriter | output | The output. |
Remarks
The filtering is controlled by the IFilterRules instance passed to the constructor (or by DefaultFilterRules if not explicitly defined).