Skip to content

Extras

MarkdownViewer

Bit.BlazorUI.ExtrasMdViewerMD

BitMarkdownViewer parses Markdown into an AST and renders it straight to the Blazor render tree - no JavaScript interop, no third-party packages. Composable pipelines add exactly the flavors a document needs, untrusted input is sanitized and bounded by default, and the parsed tree, the rendering of any node and the words the renderers write are all yours to change.

Notes

To use this component, you need to install the Bit.BlazorUI.Extras (opens in a new tab) nuget package, as described in the Optional steps of the Getting started page.

Parsing and rendering happen entirely in C# (no JavaScript interop), so the component renders real DOM and works the same while prerendering, on the server, and on the client.

Raw HTML in the source is rendered as text and every link and image URL is sanitized, so untrusted Markdown cannot inject active content.

Overview

Rendering CommonMark, the GitHub flavor, and composing a pipeline of your own.

Basic

Assign the source to Markdown. With no Pipeline only the CommonMark core is understood: headings, emphasis, links and images (reference links too), lists, block quotes, code and character references - the safest starting point for untrusted content.

Native Markdown in Blazor

Rendered entirely in C# with no JavaScript - see the bit platform (opens in a new tab) site.

  • Real DOM output
  • Safe by default
    1. URLs sanitized
    2. Raw HTML shown as text

Character references decode: © 2026 — but © stays literal in code.

var html = "no innerHTML";

GitHub flavored

BitMarkdownPipelines.GitHub adds pipe tables, strikethrough, task lists, autolink literals, footnotes and alerts. An alert's kind is written out as its title beside its icon, so it does not rely on color.

Supports strikethrough and bare links like https://bitplatform.dev (opens in a new tab), plus footnotes1.

  • Parse Markdown in pure C#
  • Use any JavaScript
FeatureBasicGitHub
Headings✔✔
Tables✔

Note

Useful information that users should know, even when skimming.

Tip

Helpful advice for doing things better.

Important

Key information users need to achieve their goal.

Warning

Urgent info that needs immediate attention.

Caution

Advises about the risks of an action.

Footnotes


  1. Numbered in citation order and gathered at the end, each with a back-link. ↩︎

Custom pipeline

Compose exactly the flavors you want with BitMarkdownPipelineBuilder (BitMarkdownPipelines.Advanced is the ready-made superset). A built pipeline is immutable and thread-safe: build it once, as a field or a singleton - a new one on every render re-parses every time.

Custom pipeline ✨

Only pipe tables, strikethrough, task lists and emoji were picked. Autolinks were left out, so https://bitplatform.dev stays plain text.

  • Old approach replaced
  • Anything left to do?

Topics

Everything else about MarkdownViewer, one page per topic.

Feedback

Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.