A markdown parser is written in Go. Easy to extend, standard(CommonMark) compliant, well structured.golang-commonmark may be a good choice, but it seems to be a copy of markdown-it. blackfriday.v2 is a fast and widely-used implementation, but is not CommonMark-compliant and cannot be extended from outside of the package, since its AST uses structs instead of interfaces. Furthermore, its behavior differs from other implementations in some cases, especially regarding lists: Deep nested lists don't output correctly #329, List block cannot have a second line #244, etc. This behavior sometimes causes problems. If you migrate your Markdown text from GitHub to blackfriday-based wikis, many lists will immediately be broken. As mentioned above, CommonMark is complicated and hard to implement, so Markdown parsers based on CommonMark are few and far between.
Features
- Markdown is poor in document expressions compared to other light markup languages such as reStructuredText
- We have extensions to the Markdown syntax, e.g. PHP Markdown Extra, GitHub Flavored Markdown
- Markdown has many dialects
- GitHub-Flavored Markdown is widely used and is based upon CommonMark, effectively mooting the question of whether or not CommonMark is an ideal specification
- AST-based; preserves source position of nodes
- Written in pure Go