Back to Hugo

transform.HTMLToMarkdown

docs/content/en/functions/transform/HTMLtoMarkdown.md

0.161.1841 B
Original Source

{{< new-in "0.151.0" />}}

[!note] This function is experimental and its API may change in the future.

The transform.HTMLToMarkdown function converts HTML to Markdown by utilizing the html-to-markdown Go package.

Usage

go-html-template
{{ .Content | transform.HTMLToMarkdown | safeHTML }}

Plugins

The conversion process is enabled by the following html-to-markdown plugins:

PluginDescription
BaseImplements basic shared functionality
CommonMarkImplements Markdown according to the Commonmark Spec
TableImplements tables according to the GitHub Flavored Markdown Spec