markdown
Helpers for writing Markdown safely: escaping, links, code, quotes, tables and heading anchors.
Everything here produces Markdown text; nothing parses it. The functions make untrusted text and awkward characters (backticks, pipes, brackets, parentheses) come out literally.
Install
Section titled “Install”Cargo feature markdown (enabled by default). To compile only this module:
or in Cargo.toml:
Import path: helpers4::markdown.
| Item | What it does |
|---|---|
blockquote | Turns text into a Markdown blockquote by prefixing every line with > . |
code_block | A fenced code block for code, tagged with language. |
escape | Escapes text so that Markdown shows it literally instead of interpreting it. |
heading_slug | The anchor GitHub gives to a heading: "Hello, World!" becomes "hello-world". |
inline_code | Wraps text in a Markdown code span, using enough backticks for the text to show literally. |
link | A Markdown link [text](url), with the characters that would break it made safe. |
table | A GitHub-flavored Markdown table. |
