HtmlForgeX

API Reference

Class

MarkdownOptions

Namespace HtmlForgeX.Markdown
Assembly HtmlForgeX

Configuration options for Markdown rendering.

Inheritance

  • Object
  • MarkdownOptions

Constructors

public MarkdownOptions() #

Properties

public Int32 HeadingsBaseLevel { get; set; } #

The base heading level for rendered headings. For example, if set to 2, an H1 in Markdown will render as H2. Default is 2.

public Boolean OpenLinksInNewTab { get; set; } #

Whether to open links in a new tab by adding target="_blank". Default is true.

public Boolean Sanitize { get; set; } #

Whether to sanitize the output to prevent XSS attacks. Default is true.

public MarkdownTableMode TableMode { get; set; } #

How to render Markdown tables. Default is plain HTML tables.

public Boolean AutolinkBareUrls { get; set; } #

Automatically convert bare URLs into links. Default is true.

public Boolean GenerateHeadingIds { get; set; } #

Generate id attributes for headings using a slug of the heading text. Default is false.

public Boolean SupportSetextHeadings { get; set; } #

Support Setext-style headings (underlines with ==== or ----). Default is true.

public MarkdownTaskListStyle TaskListStyle { get; set; } #

Visual style for Markdown task list checkboxes. Default is Plain.

public MarkdownDataTablesOptions DataTables { get; set; } #

DataTables-specific options when TableMode is set to DataTables.

public Boolean NormalizeEscapedNewlines { get; set; } #

When true, converts escaped newline sequences ("\\n", "\\r\\n") into real newlines before parsing. Helps when content was authored in verbatim strings. Default is true.

public MarkdownSpacing Spacing { get; set; } #

Controls typographic spacing for Markdown blocks. Implemented via a small scoped CSS applied to a wrapper element so hosts get consistent results. Default is Normal.

public Boolean AllowRawHtmlBlocks { get; set; } #

When true, raw HTML blocks (lines starting with '<') are passed through to output rather than encoded. Content is still sanitized when Sanitize is true (e.g., <script> tags removed). Default is false.

public Boolean AllowRawHtmlInline { get; set; } #

When true, preserves inline HTML tags (e.g., <span>, <a>, <img>) within paragraphs and list items. Placeholders protect them from encoding and they are restored (and sanitized if Sanitize). Default is false.

public String BaseUri { get; set; } #

Optional base URI used to resolve relative links and images. When set, any markdown link/image without a scheme (and not starting with //, #, mailto:, data:) will be converted to an absolute URL using this base.