code-browser docs examples markdown-rendering.md
4.5 kB · 240 lines
Markdown
at main


title: Markdown rendering test page purpose: every feature of the rendered view, for trying it by hand #

Markdown rendering test page #

Open this file in code-browser and press Render (⇧⌘V). Each section exercises one part of the rendered view, and the Outline lists them all. Compare this commit with the one before it to see changed blocks.

Text and inline markup #

Plain text with emphasis, strong, struck, inline code, a ⌘K chord, H2O and x2.

A blockquote, with a second line that continues it.


Lists #

  • An item
  • Another, with a nested list
    • nested one
    • nested two
  • A third
  1. First
  2. Second
  3. Third

Tasks:

Table #

Feature Where it runs Status
Markdown VM done
Math VM done
Mermaid VM (svgdom) prototype

Code #

// Highlighted with the viewer's own colours.
export function greet(name: string): string {
  return `Hello, ${name}`
}
echo "costs $5 and $10"   # dollars in code are not math

Images #

A repository image (loads from git):

code-browser mark

A remote image on the allow-list (raw.githubusercontent.com is a default):

GitHub-hosted image

Remote images off the allow-list (blocked, with "Allow host"):

build license

Math #

Inline: the energy is $E = mc^2$, and $\sqrt{a^2 + b^2}$ is a length. Prices stay text: it costs $5 and $10.

Display, on its own lines:

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

One line: $$\sum_{k=1}^{n} k = \frac{n(n+1)}{2}$$

As a fence:

\begin{pmatrix} a & b \\ c & d \end{pmatrix}
\begin{pmatrix} x \\ y \end{pmatrix}
=
\begin{pmatrix} ax + by \\ cx + dy \end{pmatrix}

Macros that could link or style are off: $\href{https://example.com}{x}$

Mermaid #

Flowchart #

ClientAPI gatewayServiceAuth service with a longerlabelDatabase

Sequence #

Open README.mdStart (warm pool)RenderParse the fileBlocks with source linesRendered viewReviewerAppVMReviewerAppVM

Class #

Sandbox+exec(argv)+pipe(argv)+dispose()VzSandbox

State #

RenderSourceSourceRendered

Entity relationship #

hascontainsREVIEWTHREADENTRY

Gantt #

Markdown renderingIn the VMFollow-upsMathMermaid2026-09-252026-09-262026-09-272026-09-282026-09-29

Pie #

Where time went45%30%25%LayoutShimsFonts

gitGraph (rough) #

mainfeature0-9e3779b1-3c6ef36

Mindmap #

VMsvgdomrendering

Architecture #

Review VMGuest agentEgress proxyRepository

A syntax error (stays code) #

graph LR
  a --> ((

HTML #

Allowed HTML: details and summary

This renders, with every attribute except the allowed few stripped.

A centred paragraph, from align="center".

Blocked HTML shows as source: