Skip to main content

Module markdown

Module markdown 

Source
Expand description

Markdown, rendered for a terminal.

Tracker’s descriptions and comments are markdown, and printing them raw makes a person read the syntax instead of the text. This module renders them with termimad, under two constraints that are not negotiable:

  1. Only for a terminal. Machine output keeps the source text verbatim — an agent reads markdown perfectly well, and reflowing it would change bytes a caller may be diffing.
  2. The block stays marked as someone else’s. Rendering makes the text readable; it must not make it look like the tool talking. Every line keeps a dim margin bar, so where the quoted block starts and ends is never a matter of interpretation (ADR 1).

Functions§

image_reference
![alt](url), when that is the whole line.
image_references
Every whole-line image reference in body, in the order they appear.
quoted
Render body and mark every line as quoted text.
render
Render body as markdown, wrapped to width.