Generated by examples/links-and-media.js, covering link, image, imageWithSize, anchor, namedAnchor, quote, alert, footnoteRef/footnoteDefs, badge, tag, collapsible, ins/sub/sup, br, mention, issueRef, emoji, colorSwatch, mathInline/mathBlock, comment, and the small formatting helpers.
A fixed-height variant, for when a raw markdown image tag can’t control size:
anchor('_A Header With Special Characters!_') → #a-header-with-special-characters
Every line of a multi-line string gets its own blockquote marker:
First line of the quote. Second line of the quote.
GitHub Alerts
A blockquote whose first line is a
[!TYPE]marker; type must be one of NOTE, TIP, IMPORTANT, WARNING, or CAUTION: [!NOTE] Highlights information that users should take into account, even when skimming. [!WARNING] Urgent info that needs immediate attention to avoid problems.
This library ships as a fork of the archived markdown-builder1, with a few enhancements of its own2.
Reference a footnote inline with footnoteRef(id); render all of the definitions together, wherever you want them to appear, with footnoteDefs(entries). There’s no auto-numbering – you supply each id.
↑ up, ↓ down, ← left, → right (a non-breaking space before this text, from space())
underlined, subscript, and superscript all render via their HTML tags, since GFM has no dedicated syntax for them.
This line ends with a hard break from br(), so this text starts on a new line without a blank paragraph between them.
mention('octocat') → @octocatissueRef(42) → #42emoji('tada') → :tada:colorSwatch('#1d9bf0') → #1d9bf0 (GitHub renders a swatch next to a valid hex/rgb/hsl value)Inline: $E = mc^2$
\[\sum_{i=1}^{n} i = \frac{n(n+1)}{2}\]Comments render nothing in this spot; view the raw markdown to see it.
See Chalarangelo/markdown-builder , now archived. ↩
Tables, GitHub alerts, checked task items, aligned columns, nested lists, footnotes, math, and more – some definitions span multiple lines, and the continuation stays indented under the marker. ↩