RtfToHtmlHtmlTagCallback Property

Get or set the HtmlTagCallback method to use for custom filtering of HTML tags and content.

Definition

Namespace: MimeKit.Text
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public HtmlTagCallback? HtmlTagCallback { get; set; }

Property Value

HtmlTagCallback
The html tag callback.

Remarks

Gets or sets the HtmlTagCallback method to use for custom filtering of HTML tags and content.

The callback is invoked for each of the tags that RtfToHtml generates when rendering RTF content (div for paragraphs, span for character formatting, a for hyperlinks, br for line breaks, and table, tr and td for tables) as well as for each of the tags of any HTML encapsulated within the RTF document (see ExtractEncapsulatedHtml). As with HtmlToHtml, the end tags are only passed to the callback if InvokeCallbackForEndTag is set when the start tag is handled, and setting DeleteTag or SuppressInnerContent may be used to remove a tag or an entire element.

Content written by the AttachmentPlaceholderCallback is not passed to this callback.

  Security Note

Encapsulated HTML is untrusted input. If the output is going to be displayed in a web browser or HTML viewer, then a callback should be used to filter out any elements and attributes that are not safe (scripts, event handlers, remote content, etc).

See Also