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.

Syntax extensions

Typography, line breaks, front matter, containers, definition lists, abbreviations and figures, and mathematics.

Typography

UseEmphasisExtras() adds ~sub~, ^sup^, ++ins++ and ==mark== as real elements; UseSmartyPants() curls quotes and turns --, --- and ... into dashes and an ellipsis. Code is never rewritten.

Water is H2O, the area of a circle is πr2, and this release adds streaming and drops the old overload - so read the migration notes first.

“Typography matters,” she said – and it’s hard to disagree… The 2024–2026 range uses an en dash; an aside uses an em dash — like this one.

Code keeps every character: --- "not curled" ... and 1 + 2 = 3 is plain prose.

Line breaks

Markdown reflows a single newline into the paragraph. UseSoftLineAsHardLine() makes every newline a break - what a chat or comment box expects.

Default

Roses are red Violets are blue Markdown reflows Unless you tell it not to

UseSoftLineAsHardLine()

Roses are red
Violets are blue
Markdown reflows
Unless you tell it not to

Front matter

UseFrontMatter() reads a leading --- (YAML) or +++ (TOML) block into a node that renders nothing, instead of a rule and a heading. OnParsed hands over the parsed document, and BitMarkdownFrontMatterNode.Find reads the block's raw text out of it.

Default

title: Release notes date: 2026-09-09

Release notes

The metadata above describes the file; it is not part of the document.

UseFrontMatter()

Release notes

The metadata above describes the file; it is not part of the document.

Metadata read from the AST: title: Release notes | date: 2026-09-09

Containers

UseContainers() adds ::: fences: the word after the fence becomes the class, the rest of the line the title. note, info, tip, success, warning, caution and danger are pre-styled, details renders a real collapsible <details>, and containers nest.

Start here

Containers are fenced with three colons. The first word names the container.

Read this first

The rest of the line is the title, and the body is ordinary Markdown.

Containers nest, so an aside can sit inside one.

How the fence is read

This one is a real <details>, so it opens and closes.

A name the stylesheet has no opinion about is a plain block you style yourself.

Definition lists, abbreviations & figures

Three documentation flavors that map to real HTML: UseDefinitionLists() (a term, then : its definition), UseAbbreviations() (*[HTML]: ... expands every whole-word use into an <abbr>) and UseFigures() (a titled image on its own becomes a <figure> captioned by its title, never by its alt text).

Pipeline
The immutable set of flavors a document is parsed with.
Build it once and share it.
AST
The tree the parser produces and the renderer writes HTML from.
The bit platform logo
A titled image becomes a captioned figure

Mathematics

UseMathematics() keeps $inline$ and $$display$$ TeX verbatim - safe from emphasis - in .math-inline / .math-display elements, and leaves prices such as $5 alone. Typesetting is the page's choice: here KaTeX renders each element after the viewer draws it.

No typesetter

Euler's identity, $e^{i\pi} + 1 = 0$, in one line.

$$\int_0^1 x^2 \, dx = \frac{1}{3}$$

Prices are left alone: this costs $5 and that one $10.

KaTeX

Euler's identity, $e^{i\pi} + 1 = 0$, in one line.

$$\int_0^1 x^2 \, dx = \frac{1}{3}$$

Prices are left alone: this costs $5 and that one $10.

Feedback

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