12.4.0 is a breaking release (see Versioning). Most applications only need to update the packages together and recompile; check the changes below that apply to yours.
The extension packages of 12.4.0 (SyntaxHighlighting, Svg, Mermaid, Math) require MarkView.Avalonia 12.4.0, and apps built against 12.3.0 must be recompiled: UseMath(), UseMermaid() and AddMermaid() gained optional parameters, which is source compatible but not binary compatible.
A viewer without a Pipeline now uses UseGitHubExtensions() instead of UseSupportedExtensions(), so documents render as on GitHub:
~text~ is strikethrough instead of subscript.> [!NOTE]), footnotes, <details> blocks and the HTML subset render.^superscript^, ++underline++ and ==highlight== are no longer parsed.To keep the previous rendering, set the previous pipeline as the default:
MarkdownViewerDefaults.Pipeline = new MarkdownPipelineBuilder().UseSupportedExtensions().Build();
See Markdown and the pipeline for the differences and how to combine them.
UseAbbreviations(), UseCitations(), UseFigures(), UseFootnotes(), UseAlertBlocks() and UseMediaLinks() were removed from MarkView.Avalonia.MarkdownExtensions, the extension methods of MarkdownPipelineBuilder. They were identical to Markdig's own, and four of them clashed with them (error CS0121) when both namespaces were imported. Code that calls them keeps compiling and now calls Markdig's methods. The MarkdownViewer methods of the same names (viewer.UseFootnotes()…) are unchanged.
A right-click on the viewer opens its new context menu (copy, copy as Markdown, copy a link or a table, save an image, select all). Set your own ContextFlyout or ContextMenu to replace it, or remove it:
<mv:MarkdownViewer ContextFlyout="{x:Null}" />
See Selection and copy.
A diagram renders once its viewer is attached to a window, in the background on the desktop and, in the browser, once it comes within a screen of the visible area. A diagram that is never shown is never rendered.
MarkdownSelectableTextBlock and SlugGenerator are sealed. Style headings and paragraphs through their control themes instead of deriving from them.
These are not breaking, but change what a document shows:
ShowCodeBlockCopyButton, on by default); the language label is off by default (ShowCodeBlockLanguage).IsLazyRenderingEnabled, on by default). Turn it off for a viewer that is rendered to a bitmap without being scrolled; see Lazy rendering.DetectTextDirection, on by default).HighContrastMode, System by default).The release notes list every change of the release.