Extension methods for configuring Markdig pipelines for use with MarkView.Avalonia.
Opt-in extensions such as footnotes or alert blocks are enabled with Markdig's own methods
(UseFootnotes(), UseAlertBlocks()…); this class deliberately defines no method
with the same name as one of Markdig's, since code importing both namespaces could not call it.
public static class MarkdownExtensions
kind:method, kind:property, kind:ctor. Press Esc to clear.UseExtendedAlertBlocks(MarkdownPipelineBuilder)Enables Markdig GitHub-style alert block parsing (as UseAlertBlocks() does), plus the Obsidian-style extras that Markdig alone leaves as a plain blockquote: foldable alerts (> [!NOTE]- starts collapsed, > [!NOTE]+ starts expanded) and custom titles (> [!TIP] My title). Can be combined with Markdig's UseAlertBlocks() in either order. Activate on the viewer with viewer.UseAlertBlocks().UseGitHubExtensions(MarkdownPipelineBuilder, MarkdownExtensionsOptions?)Enables the Markdig extensions that make a document render as it does on GitHub: pipe tables, task lists, strikethrough (~~text~~ and ~text~), autolinks, emoji shortcodes, alerts (> [!NOTE]), footnotes, CJK-friendly emphasis, hidden YAML front matter, collapsible HTML <details> blocks (see UseHtmlDetails(MarkdownPipelineBuilder)) and the HTML elements READMEs use, such as centered headers, badges and <kbd> (see UseHtmlSubset(MarkdownPipelineBuilder)). This is the pipeline a MarkdownViewer uses when none is set. Math and Mermaid diagrams come from their own packages (UseMath(), UseMermaid()).UseHardlineBreaks(MarkdownPipelineBuilder)Enables Markdig hardline-break parsing: every soft line break within a paragraph renders as an explicit line break instead of collapsing to a space. Activate on the viewer with viewer.UseHardlineBreaks().UseHtmlDetails(MarkdownPipelineBuilder)Renders HTML <details> / <summary> elements as collapsible blocks, as GitHub does: the summary line (or "Details" without one) toggles the body, which starts hidden unless the tag is <details open>. The markdown between the tags, separated from them by blank lines, is rendered as usual; details elements can nest. Tags without a match, and any other HTML, are left as they are. Part of UseGitHubExtensions(MarkdownPipelineBuilder, MarkdownExtensionsOptions?).UseHtmlSubset(MarkdownPipelineBuilder)Renders a safe subset of HTML with native controls, as GitHub shows it in a README, without running or fetching anything but images: href, src, alt, title, width, height, align and dir attributes are read. Any other tag, and a tag without its match, is dropped, and the text around it shows; the content of <script> and <style> is dropped too. Part of UseGitHubExtensions(MarkdownPipelineBuilder, MarkdownExtensionsOptions?) and UseSupportedExtensions(MarkdownPipelineBuilder, MarkdownExtensionsOptions?).UseSupportedExtensions(MarkdownPipelineBuilder, MarkdownExtensionsOptions?)Enables a broader set of Markdig extensions supported by MarkView.Avalonia: pipe and grid tables, task lists, all emphasis extras (~~strike~~, ~sub~, ^sup^, ++ins++, ==mark==), autolinks, emoji shortcodes, CJK-friendly emphasis, hidden YAML front matter and the HTML subset (see UseHtmlSubset(MarkdownPipelineBuilder)). Unlike UseGitHubExtensions(MarkdownPipelineBuilder, MarkdownExtensionsOptions?), ~text~ is subscript, and alerts, footnotes and details blocks are not enabled.UseThinkingBlocks(MarkdownPipelineBuilder, ThinkingBlockOptions?)Shows the reasoning a language model writes before its answer, between tags such as <think> and </think> (see TagNames), in a block that folds away. The reasoning is markdown. During a streaming session the block shows "Thinking…" and stays expanded until the closing tag arrives, then collapses under a title with the time it took; in any other document it starts collapsed. Each tag goes at the start of a line; the closing tag can also end the reasoning's last line. A block without its closing tag runs to the end of the document. Activate on the viewer with viewer.UseThinkingBlocks().