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 html-to-markdown Go 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:
October 27, 2026
:
content: Standardize print and render usage (c165900b1)
Improve this page