transform.HTMLToMarkdown
Returns the given HTML converted to Markdown.
- Syntax
- transform.HTMLToMarkdown INPUT
- Returns
- string
Usage
The transform.HTMLToMarkdown function returns the given HTML converted to Markdown, using the JohannesKaufmann/html-to-markdown package.
This function is experimental and its API may change in the future.
The function uses these html-to-markdown plugins to perform the conversion:
| Plugin | Description |
|---|---|
| Base | Implements basic shared functionality |
| CommonMark | Implements Markdown according to the CommonMark specification |
| Table | Implements tables according to the GitHub Flavored Markdown specification |
Examples
{{ transform.HTMLToMarkdown "<p>An <em>emphasized</em> word</p>" }} → An *emphasized* wordConverting the content of the current page:
{{ .Content | transform.HTMLToMarkdown | safeHTML }}Last updated:
November 8, 2026
:
content: Remove categories from front matter (1cc1dd83a)
Improve this page