API Reference
HtmlOptions
Options controlling HTML rendering style and asset delivery.
Inheritance
- Object
- HtmlOptions
Constructors
public HtmlOptions() #Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
public HtmlKind Kind { get; set; } #Fragment vs full document. Default: Document when used with HtmlOptions).
public HtmlStyle Style { get; set; } #Built-in style preset. Default: Clean.
public CssDelivery CssDelivery { get; set; } #How to deliver CSS. Default: Inline.
public AssetMode AssetMode { get; set; } #Connectivity mode for external assets (CDNs). Default: Online.
public String CssHref { get; set; } #Optional explicit CSS URL for LinkHref.
public List<String> AdditionalCssHrefs { get; } #Additional CSS URLs to include (link or inline depending on AssetMode).
public List<String> AdditionalJsHrefs { get; } #Additional JS URLs to include (script src or inline depending on AssetMode).
public String Title { get; set; } #Page title for full document rendering. Default: "Document".
public String BodyClass { get; set; } #Wrap content in <article> with this CSS class. Set to null to avoid wrapper. Default: "markdown-body".
public Boolean IncludeAnchorLinks { get; set; } #Include per-heading anchor links (e.g. '#') in HTML rendering. Default: false.
public Boolean ShowAnchorIcons { get; set; } #When true, show a small anchor icon next to headings (on hover by default).
public String AnchorIcon { get; set; } #Glyph or text for the anchor icon (e.g., "π", "ΒΆ"). Default: "π".
public Boolean CopyHeadingLinkOnClick { get; set; } #When true, clicking the anchor icon copies a deep link to the clipboard.
public Boolean BackToTopLinks { get; set; } #Render small "Back to top" links for headings at or below the given level. 1=H1, 2=H2, etc. Set to false to disable.
public Int32 BackToTopMinLevel { get; set; } #Heading level threshold for BackToTopLinks. Default: 2 (H2+).
public String BackToTopText { get; set; } #Text for the back-to-top link.
public Boolean ThemeToggle { get; set; } #When true, writes a small theme toggle control if Style supports it. Default: false.
public AssetEmitMode EmitMode { get; set; } #Emit tags vs manifest-only. Default: Emit.
public PrismOptions Prism { get; set; } #Optional Prism highlighting configuration.
public MarkdownCodeBlockHtmlRenderer CodeBlockHtmlRenderer { get; set; } #Optional callback that can replace HTML emitted for individual code blocks. Returning null falls back to the default <pre><code> rendering.
public MarkdownSemanticFencedBlockHtmlRenderer SemanticFencedBlockHtmlRenderer { get; set; } #Optional callback that can replace HTML emitted for semantic fenced blocks. Returning null falls back to standard fenced-code presentation.
public MarkdownTocHtmlRenderer TocHtmlRenderer { get; set; } #Optional callback that can replace HTML emitted for realized TOC placeholders. Returning null falls back to the built-in enhanced TOC rendering.
public MarkdownFootnoteSectionHtmlRenderer FootnoteSectionHtmlRenderer { get; set; } #Optional callback that can replace HTML emitted for the aggregated footnote section. Returning null falls back to the built-in section/ordered-list rendering.
public List<MarkdownBlockHtmlRenderExtension> BlockRenderExtensions { get; } #Optional block render extensions that can override HTML emitted for specific block types. Later registrations win when block types overlap.
public String CssScopeSelector { get; set; } #Prefix selectors in emitted CSS with this scope selector to avoid collisions. Default: "article.markdown-body".
public RawHtmlHandling RawHtmlHandling { get; set; } #Controls how raw HTML blocks are emitted. Default: Allow. For untrusted chat scenarios, prefer Strip or Escape.
public Boolean ExternalLinksTargetBlank { get; set; } #When true, external HTTP(S) links are rendered with target="_blank". Default: false.
public String ExternalLinksRel { get; set; } #Optional rel attribute value to apply to external HTTP(S) links. Common safe value: noopener noreferrer. Default: empty (no rel attribute added).
public String ExternalLinksReferrerPolicy { get; set; } #Optional referrerpolicy value to apply to external HTTP(S) links. Common privacy value: no-referrer. Default: empty (no referrerpolicy attribute added).
public Uri BaseUri { get; set; } #Optional base URI used for origin-based restrictions during HTML rendering. When set and RestrictHttpLinksToBaseOrigin/RestrictHttpImagesToBaseOrigin are enabled, absolute HTTP(S) links/images that are cross-origin are suppressed. Default: null.
public Boolean RestrictHttpLinksToBaseOrigin { get; set; } #When true and BaseUri is an absolute HTTP(S) URI, suppresses cross-origin absolute HTTP(S) links. Relative links and non-HTTP schemes (e.g., mailto) are not affected. Default: false.
public Boolean RestrictHttpImagesToBaseOrigin { get; set; } #When true and BaseUri is an absolute HTTP(S) URI, suppresses cross-origin absolute HTTP(S) images. Relative image URLs are not affected. Default: false.
public Boolean BlockExternalHttpImages { get; set; } #When true, suppresses absolute external HTTP(S) images regardless of BaseUri. Useful for privacy-sensitive/untrusted content. Default: false.
public Boolean ImagesLoadingLazy { get; set; } #When true, emits loading="lazy" on rendered <img> tags. Default: false.
public Boolean ImagesDecodingAsync { get; set; } #When true, emits decoding="async" on rendered <img> tags. Default: false.
public String ImagesReferrerPolicy { get; set; } #Optional referrerpolicy value to apply to rendered <img> tags. Common privacy value: no-referrer. Default: empty (no referrerpolicy attribute added).
public List<String> AllowedHttpLinkHosts { get; } #Optional allowlist of host patterns for absolute HTTP(S) links during HTML rendering. When non-empty, absolute HTTP(S) links are suppressed unless their host matches an entry. Supported patterns: - example.com: exact host match - .example.com: example.com and any subdomain - *.example.com: any subdomain only (not the apex) Default: empty (allow all hosts).
public List<String> AllowedHttpImageHosts { get; } #Optional allowlist of host patterns for absolute HTTP(S) images during HTML rendering. When non-empty, absolute HTTP(S) images are suppressed unless their host matches an entry. Pattern rules match AllowedHttpLinkHosts. Default: empty (allow all hosts).
public ThemeColors Theme { get; set; } #Optional theme color overrides for links, headings, and TOC.
public Boolean InjectTocAtTop { get; set; } #When true, injects a Table of Contents at the top of the document before rendering HTML. This is applied by host pipelines that have access to the MarkdownDoc model.
public String InjectTocTitle { get; set; } #Title for the injected TOC. Default: "Contents".
public Int32 InjectTocMinLevel { get; set; } #Minimum heading level to include in injected TOC. Default: 1.
public Int32 InjectTocMaxLevel { get; set; } #Maximum heading level to include in injected TOC. Default: 3.
public Boolean InjectTocOrdered { get; set; } #Whether the injected TOC should be ordered (true) or unordered (false). Default: false.
public Int32 InjectTocTitleLevel { get; set; } #Heading level used for the TOC title. Default: 2.