Skip to content
Pavel edited this page Oct 22, 2026 · 9 revisions

English | Русский

Beresta.Markdown.Wpf is a WPF control that shows Markdown. Markdig parses the text, and the viewer draws it with WPF controls and templates.

The viewer in the showcase theme

Why this viewer

  • Its own fast native rendering. Markdown becomes real WPF controls, with no browser and no HTML in between — see How It Renders.
  • Full virtualization. Only the blocks you see are created: in a ScrollViewer, on a page next to other content, inside a list of messages — see Scrolling and Virtualization.
  • Selection like in a document. One selection runs across paragraphs, lists, tables and code, even through blocks out of view; copying puts plain text, Markdown and HTML on the clipboard — see Selection and Copying.
  • Easy to extend. Your own syntax becomes your own widgets, and built-in syntax can be taken over — see Extensions.
  • Easy to restyle. Every color, font and margin is a resource key, and any kind of block can get your own template — see Theming and Styles and Templates.
  • Many Markdown elements, only the ones you need. CommonMark, Markdig extensions and HTML from READMEs out of the box; the syntax of GitHub, GitLab, Obsidian, MkDocs, Docusaurus, HackMD and chats as ready-made extensions, one by one or as sets — see Supported Markdown.
  • An editor in the same drawing. The second package edits the source right where it is drawn: the blocks under the caret show their Markdown, the rest stays drawn. The source keeps the look of the drawing, from tables in columns to highlighted code; the editor finds and replaces, pastes HTML as Markdown and edits front matter by the types of its values — see Editor.

Also: a live preview that does not flicker, source line numbers, sync with an editor and two panes side by side, search and marks, coordinates for your own shapes, screen reader support.

Where to go

I want to Page
compare the viewer with other ways to show Markdown in WPF Comparison
put the viewer into my application Getting Started
see every setting and every place to hook in Settings and Hooks
know which Markdown is drawn and how to turn it on and off Supported Markdown
connect the syntax of GitHub, Obsidian or another program Sets
open links of my application myself Application Links
change colors and fonts, add a dark theme Theming
draw a kind of block my own way Styles and Templates
add my own syntax Extensions
show a chat or a feed of messages Scrolling and Virtualization
show a preview next to an editor Live Preview
edit Markdown right where it is drawn Editor
find and replace in the source of the editor Marks and Search
highlight the syntax of code blocks Code Blocks
show an answer of a model as it streams Live Preview
find text, mark changes and comments Marks and Search
put my own buttons and shapes next to the text Coordinates
show two versions of a document side by side Source Lines and Two Panes
change the look of task boxes Task Lists
load images from my own storage Images
show text from a chat or a model safely Untrusted Text
decide what is copied Copying

Showcase

The repository has a showcase application with the scenarios from this wiki: a full document with a table of contents, a custom look, extensions, ready-made extensions and sets with a document in the syntax of every program, search, buttons in the margin, copying, live preview, two panes, a large document, a chat of ten thousand messages, a streamed answer and the editor. Run it from the repository root:

dotnet run --project Beresta.Markdown.Wpf.Showcase

Beresta.Markdown.Wpf

Basics

Working with Text

Appearance

Integration

Editing

Your Own Syntax

Ready-made Extensions


По-русски

Основы

Работа с текстом

Оформление

Встраивание в приложение

Правка

Свой синтаксис

Готовые расширения

Clone this wiki locally