MermaidBlockRenderer Class

Definition

Assembly MarkView.Avalonia.Mermaid.dll
Inherits Object → Markdig.Renderers.MarkdownObjectRenderer{MarkView.Avalonia.Rendering.AvaloniaRenderer,Markdig.Syntax.FencedCodeBlock} → AvaloniaObjectRenderer<TObject>
Implements Markdig.Renderers.IMarkdownObjectRenderer
Show inherited members (11)

Handles all Markdig.Syntax.FencedCodeBlock nodes. Mermaid blocks are rendered to SVG via Mermaider.MermaidRenderer (pure .NET, no browser required); non-mermaid fenced blocks are rendered as styled code blocks and respect any CodeHighlighter registered by the SyntaxHighlighting extension. While IsProvisional(MarkdownObject) holds for a block (it contains the end of the text being streamed), a Mermaid fence is rendered as a mermaid code block and no diagram render is scheduled; it renders as a diagram once a blank line or another block follows it. A diagram renders as soon as it comes within a screen of the viewport. Where threads are available (not in the browser), every diagram also starts rendering in the background once it is in a window, so that scrolling to it later costs nothing. With IsImageZoomEnabled, clicking a rendered diagram opens it in the viewer's lightbox, as an image, where it is fitted to the view and can be zoomed and panned.

public sealed class MermaidBlockRenderer(MermaidStyle style = MermaidStyle.Quiet) : AvaloniaObjectRenderer<FencedCodeBlock>, IMarkdownObjectRenderer
Tip: use kind:method, kind:property, kind:ctor. Press Esc to clear.

Constructors (1)

Properties (1)

Methods (1)