HtmlTokenizerScriptingEnabled Property

Get or set whether the tokenizer should behave as if scripting is enabled.

Definition

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

Property Value

Boolean
if the tokenizer should behave as if scripting is enabled; otherwise, .

Remarks

Gets or sets whether the tokenizer should behave as if scripting is enabled.

This corresponds to the scripting flag described in the HTML5 specification and controls how the content of <noscript> elements is tokenized. When scripting is enabled, the content of a <noscript> element is treated as raw text and emitted as an HtmlDataToken. When scripting is disabled, the content is tokenized as normal markup (i.e. as tags, comments and character data).

  Security Note

If the tokens are being used to filter HTML that will later be rendered by another application (such as a web browser), then this value should match whether scripting will be enabled in that application. Otherwise, the renderer may interpret the content of <noscript> elements differently than the tokenizer did, allowing markup to bypass the filter. See NoScriptHandling for details.

See Also