V2 Release
The new version v2 has been released 🚀
It is a rewrite from the ground up — even more accurate than the v1 version!
Some new features:
- Nested lists: Improved handling of deeply nested lists
- Hard line breaks: Proper support for
<br />
tags - Smart escaping: Only escape characters if they would be mistaken for markdown syntax
- Powerful Plugins: The new architecture allows plugins to hook into every part of the converting process.
- Improved Golang API: Simpler, more ergonomic API. For most cases
htmltomarkdown.ConvertString(input)
works out of the box. - CLI: The cli is now part of the repository
- and more much...
Try it now
Since there are breaking changes, the path now has the "/v2" suffix. This also allows you to run v1 and v2 in parallel.
go get -u github.com/JohannesKaufmann/html-to-markdown/v2
package main
import (
"fmt"
"log"
htmltomarkdown "github.com/JohannesKaufmann/html-to-markdown/v2"
)
func main() {
input := `<strong>Bold Text</strong>`
markdown, err := htmltomarkdown.ConvertString(input)
if err != nil {
log.Fatal(err)
}
fmt.Println(markdown)
// Output: **Bold Text**
}