BlackSharp.UI.Avalonia.Markdown 1.0.1

Prefix Reserved
dotnet add package BlackSharp.UI.Avalonia.Markdown --version 1.0.1
                    
NuGet\Install-Package BlackSharp.UI.Avalonia.Markdown -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BlackSharp.UI.Avalonia.Markdown" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BlackSharp.UI.Avalonia.Markdown" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="BlackSharp.UI.Avalonia.Markdown" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BlackSharp.UI.Avalonia.Markdown --version 1.0.1
                    
#r "nuget: BlackSharp.UI.Avalonia.Markdown, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BlackSharp.UI.Avalonia.Markdown@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BlackSharp.UI.Avalonia.Markdown&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=BlackSharp.UI.Avalonia.Markdown&version=1.0.1
                    
Install as a Cake Tool

<h1 align="center">BlackSharp Markdown Viewer for Avalonia</h1>

<p align="center"> <img src="https://raw.githubusercontent.com/Blacktempel/BlackSharp.UI.Avalonia.Markdown/master/Assets/BlackSharpFull.png" width="128" height="128" alt="BlackSharp"/> </p>

NuGet NuGet downloads

.NET GitHub Sponsors PayPal License

Display Markdown release notes and documentation.

BlackSharp.UI.Avalonia.Markdown renders documents with native Avalonia controls.

This is not an official Avalonia release.

Key capabilities

  • MarkdownViewer renders CommonMark, including headings, links, emphasis, lists, quotes, code blocks and images
  • GitHubMarkdownViewer adds tables, task lists, strikethrough, autolinks, alerts, emoji shortcodes, footnotes and heading anchors
  • Relative link and image resolution, opt-in remote images and a custom image loader

The demo uses a shared text box to compare the same source in the GitHub Markdown and CommonMark previews.

Supported .NET versions

.NET version Support
.NET 8 ✅
.NET 10 ✅
.NET 11 ✅

Requirements

Add the package to a local NuGet feed or reference the library project directly. Once the feed is configured, add the package to your application:

dotnet add package BlackSharp.UI.Avalonia.Markdown

Add the following namespace to the XAML root. No additional theme include is required:

xmlns:md="clr-namespace:BlackSharp.UI.Avalonia.Markdown.Controls;assembly=BlackSharp.UI.Avalonia.Markdown"

Examples

Read-only release notes

Both controls show only the preview by default:

<md:GitHubMarkdownViewer Text="{Binding ReleaseNotes, Mode=OneWay}" />

Source editor and live preview

Set ShowEditor="True" to display the source editor. The panes sit side by side on wide layouts and stack on narrow layouts. Text binds two-way by default. Set IsReadOnly="True" to prevent edits while keeping the editor visible and its text selectable.

<md:GitHubMarkdownViewer Text="{Binding ReadmeText}"
                         ShowEditor="True"
                         EditorWatermark="Enter Markdown"
                         AllowRemoteImages="True"
                         BaseUri="https://github.com/Blacktempel/BlackSharp/blob/master/"
                         ImageBaseUri="https://raw.githubusercontent.com/Blacktempel/BlackSharp/master/"
                         LinkClicked="OnLinkClicked" />

The preview handles local fragment navigation. HTTP, HTTPS and mail links raise LinkClicked for the host to handle. The event argument is MarkdownLinkClickedEventArgs. An ILogger from BlackSharp.Core receives render and image errors, when configured.

Remote images are off by default. Enable them only if the document may trigger HTTPS requests, or supply an ImageLoader with your own allowlist and image policy. The built-in loader loads up to 16 raster images per preview, with a 4 MiB and 2 megapixel limit per image. Alt text remains visible when an image is not loaded. A custom provider can add formats such as SVG.

Scripts, frames, arbitrary CSS and local-file destinations are not supported.

Projects and development

Project Purpose
BlackSharp.UI.Avalonia.Markdown Reusable controls and NuGet package
BlackSharp.UI.Avalonia.Markdown.Demo Interactive editor and preview comparison

License

This repository is licensed under the Mozilla Public License 2.0.

Origin

Markdown parsing is provided by Markdig and HTML parsing by Html Agility Pack.

GitHub syntax follows the GFM specification and the GitHub formatting documentation.

Alert icons use GitHub's Primer Octicons under the MIT license.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 74 11/16/2026
1.0.0 86 11/8/2026