Editor Options Reference

The Options property on WinFormHtmlEditor returns the editor's settings object. The WinForms UserOption class implements the cross-platform IEditorOptions contract; the same interface is implemented by the WPF UserOption class so the algorithms that key off these properties behave identically across both controls. This page lists every member on IEditorOptions.

Namespace: SpiceLogic.HtmlEditor.Abstractions
Assembly: SpiceLogic.HtmlEditor.Abstractions.dll
Accessor: htmlEditor1.Options

KeepTextSelectedAfterFontChange Property

Determines whether the editor preserves the user's text selection after a font or color change is applied from the toolbar. The default behaviour collapses the selection to the caret -- matching MS Word -- but customers building style-rich authoring tools usually prefer the selection to stay so the user can chain multiple format commands.

Syntax
bool KeepTextSelectedAfterFontChange { get; set; }
Property Value

true to keep the selection highlighted after font/color commands; false to collapse it.

Example
// Let users chain bold + italic + color changes without re-selecting.
htmlEditor1.Options.KeepTextSelectedAfterFontChange = true;
' Let users chain bold + italic + color changes without re-selecting.
htmlEditor1.Options.KeepTextSelectedAfterFontChange = True

SacrificeOptimizationForLongHtml Property

Disables typing-time optimizations in exchange for correctness on very long documents. Enable this if you observe missing keystrokes or garbled output on multi-megabyte documents.

Syntax
bool SacrificeOptimizationForLongHtml { get; set; }
Property Value

true to disable typing optimizations; false (default) to keep them on.

Example
// Adapt for huge legal documents (> 1 MB of HTML).
htmlEditor1.Options.SacrificeOptimizationForLongHtml =
    htmlEditor1.Content.GetBodyHtml().Length > 1_000_000;

ConvertFileUrlsToLocalPaths Property

Reverses MSHTML's rewriting of local image paths to file:/// URLs when the editor reads back HTML. MSHTML normalizes <img src="C:\path\image.png"> to <img src="file:///C:/path/image.png">; setting this to true rewrites those back to original-style paths on output.

Syntax
bool ConvertFileUrlsToLocalPaths { get; set; }
Property Value

true to convert file:/// URLs back to local paths; false to leave them as MSHTML produced them.

Example
// We are saving the document next to the images on disk.
htmlEditor1.Options.ConvertFileUrlsToLocalPaths = true;
' We are saving the document next to the images on disk.
htmlEditor1.Options.ConvertFileUrlsToLocalPaths = True

UrlEncodeHyperlinkHRefs Property

Determines whether href attributes are URL-encoded when the editor serializes its HTML. Useful when downstream pipelines expect strictly URL-safe characters in anchor hrefs.

Syntax
bool UrlEncodeHyperlinkHRefs { get; set; }
Property Value

true to URL-encode href values; false (default) to emit them verbatim.

Example
htmlEditor1.Options.UrlEncodeHyperlinkHRefs = true;
htmlEditor1.Options.UrlEncodeHyperlinkHRefs = True

ConvertAbsoluteUrlsToRelativeUrls Property

When true, the editor rewrites absolute URLs that match the BaseUrl property into relative URLs at serialization time. Useful for content management systems where the same article is served from multiple hosts.

Syntax
bool ConvertAbsoluteUrlsToRelativeUrls { get; set; }
Property Value

true to convert matching absolute URLs to relative ones; false to leave them absolute.

Remarks

Has no effect unless BaseUrl is set.

Example
htmlEditor1.BaseUrl = "https://cms.example.com/articles/";
htmlEditor1.Options.ConvertAbsoluteUrlsToRelativeUrls = true;
htmlEditor1.BaseUrl = "https://cms.example.com/articles/"
htmlEditor1.Options.ConvertAbsoluteUrlsToRelativeUrls = True

EnterKeyResponse Property

Controls what the editor inserts when the user presses Enter. Most word-processor-style apps want Paragraph; most chat/email-style apps want LineBreak.

Syntax
EnterKeyResponses EnterKeyResponse { get; set; }
Property Value
  • EnterKeyResponses.LineBreak -- inserts a <br> at the caret.
  • EnterKeyResponses.Paragraph -- closes the current paragraph and opens a new one.
Example
using SpiceLogic.HtmlEditor.Abstractions;

// Email composer mode: a single Enter inserts <br>, not a new <p>.
htmlEditor1.Options.EnterKeyResponse = EnterKeyResponses.LineBreak;
Imports SpiceLogic.HtmlEditor.Abstractions

' Email composer mode: a single Enter inserts <br>, not a new <p>.
htmlEditor1.Options.EnterKeyResponse = EnterKeyResponses.LineBreak

FooterTagNavigatorFont Property

Gets or sets the font used to render the tag-breadcrumb navigator at the bottom of the editor (the strip showing html > body > p > span as the caret moves through the document).

Syntax
Font? FooterTagNavigatorFont { get; set; }
Property Value

A System.Drawing.Font instance, or null to use the editor's default font.

Example
using System.Drawing;

htmlEditor1.Options.FooterTagNavigatorFont = new Font("Consolas", 8.5f);
Imports System.Drawing

htmlEditor1.Options.FooterTagNavigatorFont = New Font("Consolas", 8.5F)

FooterTagNavigatorTextColor Property

Gets or sets the text color of the tag-breadcrumb navigator strip at the bottom of the editor.

Syntax
Color FooterTagNavigatorTextColor { get; set; }
Property Value

A System.Drawing.Color value.

Example
htmlEditor1.Options.FooterTagNavigatorTextColor = Color.SteelBlue;

DefaultHtmlType Property

Determines whether properties and methods that return "the editor's HTML" return the body fragment or the full document including <html>, <head>, and <body> wrappers, and which DOCTYPE is emitted for new documents.

Syntax
HtmlContentTypes DefaultHtmlType { get; set; }
Property Value

One of the HtmlContentTypes enum members -- BodyHtml, DocumentHtml, or one of the per-DOCTYPE document variants.

Example
using SpiceLogic.HtmlEditor.Abstractions;

htmlEditor1.Options.DefaultHtmlType = HtmlContentTypes.DocumentHtml;
string fullDoc = htmlEditor1.Content.GetDocumentHtml();
Imports SpiceLogic.HtmlEditor.Abstractions

htmlEditor1.Options.DefaultHtmlType = HtmlContentTypes.DocumentHtml
Dim fullDoc As String = htmlEditor1.Content.GetDocumentHtml()

OutputMetaGenerator Property

Determines whether a <meta name="generator" content="SpiceLogic HTML Editor"> tag is included when the editor serializes full-document HTML.

Syntax
bool OutputMetaGenerator { get; set; }
Property Value

true (default) to emit the generator <meta> tag; false to suppress it.

Example
// Strip generator marker before publishing to a public site.
htmlEditor1.Options.OutputMetaGenerator = false;
' Strip generator marker before publishing to a public site.
htmlEditor1.Options.OutputMetaGenerator = False

AutoDetectWordPaste Property

Determines whether the editor's paste pipeline auto-detects Microsoft Word content on the clipboard and applies the Word-cleanup filter before inserting. Word emits MsoNormal classes, inline mso-* styles, Office XML namespaces, and conditional comments; the cleanup filter strips these so the resulting markup blends with the rest of the document.

Syntax
bool AutoDetectWordPaste { get; set; }
Property Value

true (default) to auto-detect and clean; false to paste Word content verbatim.

Remarks

The cleanup runs only when MsIePasteBehavior is false. When MsIePasteBehavior is true, the underlying browser handles the paste and the editor cannot intercept it.

Example
htmlEditor1.Options.AutoDetectWordPaste = true;
htmlEditor1.Options.MsIePasteBehavior = false; // required for cleanup to run
htmlEditor1.Options.AutoDetectWordPaste = True
htmlEditor1.Options.MsIePasteBehavior = False ' required for cleanup to run

MsIePasteBehavior Property

Determines whether the editor delegates paste handling to the underlying browser host (MSHTML) instead of running its own paste pipeline.

Syntax
bool MsIePasteBehavior { get; set; }
Property Value

true to use MSHTML default paste; false (default) to use the editor's pipeline.

Remarks

When true, the Pasting event still fires but PastingHtmlEventArgs.PastingHtml is null -- the editor cannot inspect or rewrite the inserted HTML.

Example
// Customers who want full control over pasted content should leave this false.
htmlEditor1.Options.MsIePasteBehavior = false;
' Customers who want full control over pasted content should leave this false.
htmlEditor1.Options.MsIePasteBehavior = False

EnableTableCellMerge Property

Mirror of ITableAuthoringService.EnableTableCellMerging. Determines whether the cell-merging feature is enabled. The startup value of this option is propagated to the table authoring service.

Syntax
bool EnableTableCellMerge { get; set; }
Property Value

true to enable cell merging; false to disable it.

Example
// Disable cell merging in a simplified-authoring profile.
htmlEditor1.Options.EnableTableCellMerge = false;
' Disable cell merging in a simplified-authoring profile.
htmlEditor1.Options.EnableTableCellMerge = False

AutoResizeLargeImages Property

When true, an image pasted from the clipboard that exceeds MaxPastedImageWidth is automatically scaled down to that width (with proportional height) before insertion.

Syntax
bool AutoResizeLargeImages { get; set; }
Property Value

true to auto-resize on paste; false to insert at original dimensions.

Example
htmlEditor1.Options.AutoResizeLargeImages = true;
htmlEditor1.Options.MaxPastedImageWidth = 800;
htmlEditor1.Options.AutoResizeLargeImages = True
htmlEditor1.Options.MaxPastedImageWidth = 800

MaxPastedImageWidth Property

The width (in pixels) above which pasted images are resized when AutoResizeLargeImages is true.

Syntax
int MaxPastedImageWidth { get; set; }
Property Value

An integer pixel width. Typical values range from 600 (compact) to 1200 (high-DPI authoring). Values <= 0 disable resizing even when AutoResizeLargeImages is set.

Example
// Cap pasted images at 1024 px wide.
htmlEditor1.Options.MaxPastedImageWidth = 1024;

ZeroBorderTableGuidelineCss Property

The CSS rule the editor injects to draw the dashed guideline overlay on tables whose border attribute is 0. Customize this string to control the guideline's color, line style, or thickness.

Syntax
string ZeroBorderTableGuidelineCss { get; set; }
Property Value

A CSS rule fragment (for example "outline: 1px dashed #888;"). The default is a dashed gray outline. The rule is applied only while ShowGuidelinesForTablesWithZeroBorder is in effect.

Example
htmlEditor1.Options.ZeroBorderTableGuidelineCss = "outline: 1px dotted #c00;";

GetDocTypeValue() Method

Returns the <!DOCTYPE> declaration string the editor prepends when serializing full-document HTML. The returned value depends on the current DefaultHtmlType (HTML 4.01 vs XHTML vs HTML5).

Syntax
string GetDocTypeValue();
Returns

A DOCTYPE declaration string suitable for prepending to a full HTML document.

Example
string doctype = htmlEditor1.Options.GetDocTypeValue();
Debug.WriteLine($"Editor will emit: {doctype}");
Dim doctype As String = htmlEditor1.Options.GetDocTypeValue()
Debug.WriteLine($"Editor will emit: {doctype}")
Last updated on May 14, 2026