Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

MarkdownRendererOptions

OfficeIMO.MarkdownRenderer

Namespace
OfficeIMO.MarkdownRenderer
Assembly
OfficeIMO.MarkdownRenderer
Source revision
ba882f6b0d07 with working tree changes
Modifiers
sealed

Options controlling how Markdown is parsed and rendered to HTML for a WebView/browser host.

Inheritance

  • object
  • MarkdownRendererOptions

Usage

Explore 42 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 31

Constructors

public MarkdownRendererOptions() #

Creates a new renderer options instance and seeds generic built-in fenced block renderers.

Methods

public void ApplyFeaturePack(MarkdownRendererFeaturePack featurePack) #

Applies a host-level feature pack once.

Parameters

featurePack OfficeIMO.MarkdownRenderer.MarkdownRendererFeaturePack required
public void ApplyFenceOptionSchema(MarkdownFenceOptionSchema schema) #

Registers a fence option schema once.

Parameters

schema OfficeIMO.MarkdownRenderer.MarkdownFenceOptionSchema required
public void ApplyPlugin(MarkdownRendererPlugin plugin) #

Applies a fenced-block renderer plugin without duplicating existing language registrations.

Parameters

plugin OfficeIMO.MarkdownRenderer.MarkdownRendererPlugin required
public bool HasFeaturePack(MarkdownRendererFeaturePack featurePack) #

Returns true when the supplied host-level feature pack has already been applied.

Parameters

featurePack OfficeIMO.MarkdownRenderer.MarkdownRendererFeaturePack required

Returns

bool
public bool HasFenceOptionSchema(MarkdownFenceOptionSchema schema) #

Returns true when the supplied fence option schema is already registered.

Parameters

schema OfficeIMO.MarkdownRenderer.MarkdownFenceOptionSchema required

Returns

bool
public bool HasPlugin(MarkdownRendererPlugin plugin) #

Returns true when the supplied plugin has already registered any of its languages.

Parameters

plugin OfficeIMO.MarkdownRenderer.MarkdownRendererPlugin required

Returns

bool
public bool TryGetFenceOptionSchema(string language, out MarkdownFenceOptionSchema schema) #

Attempts to resolve the most recently-registered fence option schema for the supplied language.

Parameters

language string required
schema OfficeIMO.MarkdownRenderer.MarkdownFenceOptionSchema required

Returns

bool
public bool TryParseFenceOptions(string language, MarkdownCodeFenceInfo? fenceInfo, out MarkdownFenceOptionSet optionSet) #

Attempts to parse fence metadata using the most recently-registered schema for the supplied language.

Parameters

language string required
fenceInfo OfficeIMO.Markdown.MarkdownCodeFenceInfo? required
optionSet OfficeIMO.MarkdownRenderer.MarkdownFenceOptionSet required

Returns

bool

Properties

public MarkdownLoadOptions ReaderOptions { get; set; } #

Markdown reader options used when parsing Markdown into OfficeIMO.Markdown's typed model. Defaults are biased for untrusted input (HTML disabled and file URLs blocked).

public MarkdownHtmlExportOptions HtmlOptions { get; set; } #

HTML rendering options. These control the CSS preset and optional Prism support.

public string? BaseHref { get; set; } #

Optional base href inserted into the HTML update payload as a <base> tag. The incremental updater moves it to <head> so relative links/images resolve.

public bool NormalizeEscapedNewlines { get; set; } #

When true, normalizes escaped newlines ("\\n"/"\\r\\n") into real newlines before parsing. Useful when Markdown arrives as a JSON string literal. Default: true.

public bool NormalizeZeroWidthSpacingArtifacts { get; set; } #

When true, removes zero-width spacing artifacts such as U+200B/U+2060/U+FEFF before parsing. Default: false.

public bool NormalizeEmojiWordJoins { get; set; } #

When true, inserts a missing space between common status/emoji markers and following prose (for example, ✅Healthy becomes ✅ Healthy). Default: false.

public bool NormalizeCompactNumberedChoiceBoundaries { get; set; } #

When true, inserts missing spacing around compact numbered-choice joins (for example, or2) becomes or 2)). Default: false.

public bool NormalizeSentenceCollapsedBullets { get; set; } #

When true, inserts a missing newline before compact bullet markers emitted directly after sentence punctuation. Default: false.

public bool NormalizeSoftWrappedStrongSpans { get; set; } #

When true, joins short hard-wrapped bold labels (for example, "**Status\nOK**") into a single bold span. This helps chat-style outputs that wrap short headers mid-token. Default: false.

public bool NormalizeInlineCodeSpanLineBreaks { get; set; } #

When true, compacts inline code spans containing line breaks into a single line. This preserves strict parser compatibility for malformed model outputs. Default: false.

public bool NormalizeEscapedInlineCodeSpans { get; set; } #

When true, converts escaped inline code spans (for example, \`code\`) into standard markdown code spans. Useful for chat/model outputs that over-escape backticks. Default: false.

public bool NormalizeTightStrongBoundaries { get; set; } #

When true, inserts a missing space after a closing strong span followed immediately by a word character (for example, **Healthy**next becomes **Healthy** next). Default: false.

public bool NormalizeTightArrowStrongBoundaries { get; set; } #

When true, normalizes compact arrow-to-strong boundaries (for example, ->**Why it matters:** becomes -> **Why it matters:**). Default: false.

public bool NormalizeBrokenStrongArrowLabels { get; set; } #

When true, repairs malformed strong spans that are missing the closing delimiter immediately before an arrow-led strong label (for example, **No current failures -> **Why it matters:** becomes **No current failures** -> **Why it matters:**). Default: false.

public bool NormalizeWrappedSignalFlowStrongRuns { get; set; } #

When true, repairs malformed signal-flow bullets where an entire arrow chain was accidentally wrapped in one strong span. Default: false.

public bool NormalizeSignalFlowLabelSpacing { get; set; } #

When true, inserts missing spaces after signal-flow labels inside arrow segments (for example, -> **Why it matters:**coverage becomes -> **Why it matters:** coverage). Default: false.

public bool NormalizeCollapsedMetricChains { get; set; } #

When true, expands collapsed transcript-style metric chains into real markdown lines and converts legacy bold metric labels into plain labels with bold values. Default: false.

public bool NormalizeHostLabelBulletArtifacts { get; set; } #

When true, repairs compact host-label bullets and merges simple continuation lines (for example, -AD1 followed by healthy becomes - AD1 healthy). Default: false.

public bool NormalizeTightColonSpacing { get; set; } #

When true, inserts a missing space after a colon in prose labels (for example, Why it matters:missing coverage becomes Why it matters: missing coverage). Default: false.

public bool NormalizeHeadingListBoundaries { get; set; } #

When true, inserts a missing newline between an ATX heading and an immediately-following unordered strong-label list marker on the same line (for example, ## Summary- **Item:** value becomes ## Summary\n- **Item:** value). Default: false.

public bool NormalizeCompactStrongLabelListBoundaries { get; set; } #

When true, inserts a missing newline before compact unordered strong-label list markers that were emitted inline after punctuation or symbol characters (for example, ✅- **FSMO:** ok becomes ✅\n- **FSMO:** ok). Default: false.

public bool NormalizeCompactHeadingBoundaries { get; set; } #

When true, inserts a missing newline before compact ATX headings emitted directly after prose or symbols on the same line (for example, unexpected### Reason becomes unexpected\n### Reason). Default: false.

public bool NormalizeStandaloneHashHeadingSeparators { get; set; } #

When true, removes stray standalone # separator lines that appear immediately before a real ATX heading. Default: false.

public bool NormalizeBrokenTwoLineStrongLeadIns { get; set; } #

When true, repairs broken two-line strong lead-ins such as **Result followed by body text** tail. Default: false.

public bool NormalizeColonListBoundaries { get; set; } #

When true, inserts a missing newline between a colon and an immediately-following unordered list marker on the same line (for example, Next step:- **Item** becomes Next step:\n- **Item**). Default: false.

public bool NormalizeCompactFenceBodyBoundaries { get; set; } #

When true, inserts a missing newline between a fenced code block language token and inline body content for compact malformed transcript output (for example, ```json{"x":1} or ```mermaidflowchart LR A-->B). Default: false.

public bool NormalizeLooseStrongDelimiters { get; set; } #

When true, trims accidental whitespace immediately inside strong delimiters (for example, ** Healthy** or **Healthy ** become **Healthy**). Default: false.

public bool NormalizeOrderedListMarkerSpacing { get; set; } #

When true, inserts a missing space after ordered list markers when list item content starts immediately with emphasis delimiters (for example, 2.**Task** -> 2. **Task**). Default: false.

public bool NormalizeOrderedListParenMarkers { get; set; } #

When true, converts ordered list markers in 1) form to 1. with normalized spacing. Default: false.

public bool NormalizeOrderedListCaretArtifacts { get; set; } #

When true, removes stray caret artifacts after ordered list markers (for example, 2.^ **Task** -> 2. **Task**). Default: false.

public bool NormalizeCollapsedOrderedListBoundaries { get; set; } #

When true, inserts missing newlines between adjacent ordered list items that were emitted on one line (for example, ...)2.**Task** -> ...)\n2.**Task**). Default: false.

public bool NormalizeOrderedListStrongDetailClosures { get; set; } #

When true, repairs malformed ordered list items where a bold title is missing its closing strong delimiter before a parenthetical detail section (for example, 1. **Task(detail) -> 1. **Task** (detail)). Default: false.

public bool NormalizeTightParentheticalSpacing { get; set; } #

When true, inserts a missing space before parenthetical phrases adjacent to prose or strong spans (for example, **Task**(detail) -> **Task** (detail)). Default: false.

public bool NormalizeNestedStrongDelimiters { get; set; } #

When true, flattens malformed nested strong delimiters emitted by some model outputs (for example, **from **Service Control Manager**.**). Default: false.

public bool NormalizeDanglingTrailingStrongListClosers { get; set; } #

When true, upgrades trailing list-item strong-close artifacts (for example, - Overall health Healthy**** becomes - Overall health **Healthy**). Default: false.

public bool NormalizeMetricValueStrongRuns { get; set; } #

When true, repairs malformed strong runs used as metric values (for example, ******healthy**, **✅****Healthy**, or a missing trailing closer). Default: false.

public List<MarkdownTextPreProcessor> MarkdownPreProcessors { get; } #

Optional markdown pre-processors applied before parsing. These run after escaped newline normalization and after built-in text normalization. Default: none.

public List<IMarkdownDocumentTransform> DocumentTransforms { get; } #

Optional AST-level document transforms applied by MarkdownRenderer.RenderBodyHtml after parsing and before HTML generation. Prefer these for structural/content rewrites that should operate on MarkdownDocument instead of raw markdown text or rendered HTML strings. Default: none.

public MermaidOptions Mermaid { get; } #

Mermaid support options.

public ChartOptions Chart { get; } #

Chart.js support options.

public NetworkOptions Network { get; } #

vis-network support options.

public MathOptions Math { get; } #

Math (KaTeX) support options.

public List<MarkdownFencedCodeBlockRenderer> FencedCodeBlockRenderers { get; } #

Optional custom fenced code block renderers applied before built-in Mermaid/Chart/Math conversions. These can replace rendered <pre><code class="language-..."> blocks with host-specific HTML and optionally contribute shell head/update fragments through MarkdownFencedCodeBlockRenderer.BuildShellHeadHtml, MarkdownFencedCodeBlockRenderer.BuildBeforeContentReplaceScript, and MarkdownFencedCodeBlockRenderer.BuildAfterContentReplaceScript. The default collection is seeded with built-in Chart.js / vis-network renderers, and later additions win when aliases overlap.

public IReadOnlyList<string> AppliedFeaturePackIds { get; } #

Stable ids of host-level feature packs already applied to this renderer configuration.

public IReadOnlyList<MarkdownFenceOptionSchema> FenceOptionSchemas { get; } #

Registered fence option schemas available to renderer plugins and host integrations.

public List<MarkdownHtmlPostProcessor> HtmlPostProcessors { get; } #

Optional post-processors applied to the HTML fragment produced by MarkdownRenderer.RenderBodyHtml. These run after built-in conversions (Mermaid/Chart/Math) and after BaseHref injection. Prefer MarkdownRendererOptions.DocumentTransforms when the change can be expressed against the AST before HTML is emitted. Default: none.

public string? ContentSecurityPolicy { get; set; } #

Optional Content-Security-Policy meta tag value for the shell document (inserted as http-equiv). Leave unset unless your host wants to enforce a specific policy. Default: null.

public string? ShellCss { get; set; } #

Optional additional CSS appended to the shell document after built-in styles and assets. Use this to theme/override the default styles without replacing the full shell HTML. Default: null.

public bool EnableCodeCopyButtons { get; set; } #

When true, the shell will add "Copy" buttons to fenced code blocks (client-side). Default: false.

public bool EnableTableCopyButtons { get; set; } #

When true, the shell will add table copy actions (TSV/CSV) above rendered tables (client-side). Default: false.

public int? MaxMarkdownChars { get; set; } #

Optional guardrail limit for Markdown input size (character count). When exceeded, MarkdownRendererOptions.MarkdownOverflowHandling applies. Default: null (no limit).

public int? MaxBodyHtmlBytes { get; set; } #

Optional guardrail limit for the rendered HTML payload size (UTF-8 bytes). When exceeded, MarkdownRendererOptions.BodyHtmlOverflowHandling applies. Default: null (no limit).

public OverflowHandling MarkdownOverflowHandling { get; set; } #

Behavior when MarkdownRendererOptions.MaxMarkdownChars is exceeded. Default: OverflowHandling.Truncate.

public OverflowHandling BodyHtmlOverflowHandling { get; set; } #

Behavior when MarkdownRendererOptions.MaxBodyHtmlBytes is exceeded. Default: OverflowHandling.RenderError.