Editor Options Reference
The Options property on WpfHtmlEditor returns the editor's settings object. The WPF UserOption class implements the cross-platform IEditorOptions contract; the same interface is implemented by the WinForms 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: MyEditor.Options
KeepTextSelectedAfterFontChange Property
Gets or sets whether the editor preserves the user's text selection after a font-family, font-size, or color change. When false, the caret collapses to the end of the change after the toolbar action (matches MS Word).
Syntax
bool KeepTextSelectedAfterFontChange { get; set; }Property Value
true to keep the original range selected after a font-related toolbar action; otherwise false.
Example
// Allow chained format commands without re-selecting.
MyEditor.Options.KeepTextSelectedAfterFontChange = true;' Allow chained format commands without re-selecting.
MyEditor.Options.KeepTextSelectedAfterFontChange = TrueSacrificeOptimizationForLongHtml Property
Disables internal layout-batching optimizations for very large documents. Enable this when the document exceeds tens of kilobytes and the editor becomes visibly slow to react to formatting commands; the trade-off is more reliable behaviour at the cost of slower per-keystroke processing.
Syntax
bool SacrificeOptimizationForLongHtml { get; set; }Property Value
true to disable the optimization; otherwise false (default).
Example
MyEditor.Options.SacrificeOptimizationForLongHtml =
MyEditor.Content.GetBodyHtml().Length > 500_000;ConvertFileUrlsToLocalPaths Property
Rewrites file:// URLs in the document to plain local paths when the HTML is read back. Useful when the document is saved to disk and re-loaded as a local file.
Syntax
bool ConvertFileUrlsToLocalPaths { get; set; }Property Value
true to convert; otherwise false.
Example
MyEditor.Options.ConvertFileUrlsToLocalPaths = true;MyEditor.Options.ConvertFileUrlsToLocalPaths = TrueUrlEncodeHyperlinkHRefs Property
URL-encodes href attributes of <a> elements when the HTML is normalized.
Syntax
bool UrlEncodeHyperlinkHRefs { get; set; }Property Value
true to URL-encode hyperlink targets; otherwise false.
Example
MyEditor.Options.UrlEncodeHyperlinkHRefs = true;MyEditor.Options.UrlEncodeHyperlinkHRefs = TrueConvertAbsoluteUrlsToRelativeUrls Property
Rewrites absolute image and link URLs that fall under the current BaseUrl as relative URLs when the document is read back.
Syntax
bool ConvertAbsoluteUrlsToRelativeUrls { get; set; }Property Value
true to rewrite under-BaseUrl absolute URLs as relative; otherwise false.
Remarks
Has no effect unless BaseUrl is set.
Example
MyEditor.BaseUrl = "https://cms.example.com/articles/";
MyEditor.Options.ConvertAbsoluteUrlsToRelativeUrls = true;MyEditor.BaseUrl = "https://cms.example.com/articles/"
MyEditor.Options.ConvertAbsoluteUrlsToRelativeUrls = TrueEnterKeyResponse Property
Controls what the editor inserts when the user presses Enter inside an empty paragraph -- a new <p>, a <br />, or a split of the current block.
Syntax
EnterKeyResponses EnterKeyResponse { get; set; }Property Value
One of the EnterKeyResponses enum members.
Example
using SpiceLogic.HtmlEditor.Abstractions;
// Email composer mode -- Enter inserts a single <br /> line break.
MyEditor.Options.EnterKeyResponse = EnterKeyResponses.LineBreak;Imports SpiceLogic.HtmlEditor.Abstractions
' Email composer mode -- Enter inserts a single <br /> line break.
MyEditor.Options.EnterKeyResponse = EnterKeyResponses.LineBreakFooterTagNavigatorFont Property
Gets or sets the font used for the breadcrumb tag-navigator strip rendered at the bottom of the editor.
Syntax
Font? FooterTagNavigatorFont { get; set; }Property Value
A System.Drawing.Font, or null to use the system default.
Example
using System.Drawing;
MyEditor.Options.FooterTagNavigatorFont = new Font("Cascadia Mono", 9f);Imports System.Drawing
MyEditor.Options.FooterTagNavigatorFont = New Font("Cascadia Mono", 9F)FooterTagNavigatorTextColor Property
Gets or sets the text color of the breadcrumb tag-navigator strip at the bottom of the editor.
Syntax
Color FooterTagNavigatorTextColor { get; set; }Property Value
A System.Drawing.Color.
Example
MyEditor.Options.FooterTagNavigatorTextColor = Color.SteelBlue;DefaultHtmlType Property
Gets or sets the HTML document type that the editor emits when generating a fresh document (HTML 4.01 Transitional, XHTML 1.0, HTML5, etc).
Syntax
HtmlContentTypes DefaultHtmlType { get; set; }Property Value
One of the HtmlContentTypes enum members.
Remarks
The actual DOCTYPE string emitted for the chosen value can be retrieved at runtime via GetDocTypeValue().
Example
using SpiceLogic.HtmlEditor.Abstractions;
MyEditor.Options.DefaultHtmlType = HtmlContentTypes.Html5;Imports SpiceLogic.HtmlEditor.Abstractions
MyEditor.Options.DefaultHtmlType = HtmlContentTypes.Html5OutputMetaGenerator Property
Determines whether the editor writes a <meta name="generator"> tag identifying itself into the document <head>.
Syntax
bool OutputMetaGenerator { get; set; }Property Value
true to include the generator meta tag; false to omit it.
Example
MyEditor.Options.OutputMetaGenerator = false;MyEditor.Options.OutputMetaGenerator = FalseAutoDetectWordPaste Property
Determines whether the editor automatically scrubs MS Word HTML when the clipboard content looks like a Word paste, even if the user used the regular Paste command rather than Paste-from-Word.
Syntax
bool AutoDetectWordPaste { get; set; }Property Value
true to auto-detect and clean Word paste; otherwise false.
Example
MyEditor.Options.AutoDetectWordPaste = true;
MyEditor.Options.MsIePasteBehavior = false; // required for cleanup to runMyEditor.Options.AutoDetectWordPaste = True
MyEditor.Options.MsIePasteBehavior = False ' required for cleanup to runMsIePasteBehavior Property
Determines whether the editor delegates paste handling to MSHTML's default behavior (legacy IE paste) instead of using the editor's own paste pipeline. Set false for cleaner output; set true only when an application explicitly depends on the legacy paste behavior.
Syntax
bool MsIePasteBehavior { get; set; }Property Value
true to use MSHTML default paste; otherwise false.
Remarks
When true, the Pasting event still fires but PastingHtmlEventArgs.PastingHtml is null -- the editor cannot inspect or rewrite the inserted HTML.
Example
MyEditor.Options.MsIePasteBehavior = false;MyEditor.Options.MsIePasteBehavior = FalseEnableTableCellMerge Property
Determines whether the table authoring service permits merging selected cells. Mirrored to ITableAuthoringService.EnableTableCellMerging at startup.
Syntax
bool EnableTableCellMerge { get; set; }Property Value
true to allow cell merging; otherwise false.
Example
MyEditor.Options.EnableTableCellMerge = true;MyEditor.Options.EnableTableCellMerge = TrueAutoResizeLargeImages Property
Automatically rescales pasted or dropped images that exceed MaxPastedImageWidth pixels in width.
Syntax
bool AutoResizeLargeImages { get; set; }Property Value
true to scale oversize images down; otherwise false.
Example
MyEditor.Options.AutoResizeLargeImages = true;
MyEditor.Options.MaxPastedImageWidth = 800;MyEditor.Options.AutoResizeLargeImages = True
MyEditor.Options.MaxPastedImageWidth = 800MaxPastedImageWidth Property
The maximum width (in pixels) used by the auto-resize-on-paste logic. Ignored unless AutoResizeLargeImages is true.
Syntax
int MaxPastedImageWidth { get; set; }Property Value
A pixel value (commonly 600-1200). Values <= 0 disable resizing even if AutoResizeLargeImages is set.
Example
MyEditor.Options.MaxPastedImageWidth = 1280;ZeroBorderTableGuidelineCss Property
The CSS rule applied to tables with border="0" while the zero-border-guideline overlay is active. Customers can change the dotted style or color used to hint table boundaries during authoring.
Syntax
string ZeroBorderTableGuidelineCss { get; set; }Property Value
A CSS declaration string (for example "outline: 1px dashed #888;"). The default value is provided by the editor.
Example
MyEditor.Options.ZeroBorderTableGuidelineCss = "outline: 1px dotted #c00;";GetDocTypeValue() Method
Returns the DOCTYPE string that corresponds to the current DefaultHtmlType. The editor calls this when a fresh document is created.
Syntax
string GetDocTypeValue();Returns
The full <!DOCTYPE ...> literal that the editor will emit at the top of a new document.
Example
string doctype = MyEditor.Options.GetDocTypeValue();
Trace.WriteLine($"Editor will emit: {doctype}");Dim doctype As String = MyEditor.Options.GetDocTypeValue()
Trace.WriteLine($"Editor will emit: {doctype}")