Render Markdown content submitted by users into HTML in a Go web application without crashing on malformed input.
Convert documentation Markdown files to HTML as part of a static site generator written in Go.
Parse Markdown into an abstract syntax tree to build a custom renderer or extract structured content.
Use the blackfriday-tool command-line tool to convert Markdown files to HTML without writing any Go code.
No dependencies outside the Go standard library, add with go get and import directly into your project.
Blackfriday is a Markdown processor written in Go. It takes Markdown-formatted text as input and produces HTML output. Developers add it to Go projects as a library when they need to convert Markdown to HTML, such as for rendering user-written content in web applications or documentation tools. It was originally translated from a C project called Sundown. The library is designed to handle untrusted input without crashing. Blackfriday parsing is deliberately careful, so feeding it content from unknown users will not cause runtime failures. That said, the README notes that this safety applies to runtime stability only, not to JavaScript injection attacks in rendered output. For HTML sanitization of user content, the documentation recommends pairing Blackfriday with a separate library called Bluemonday. Blackfriday supports common Markdown extensions beyond the basic spec, including tables, fenced code blocks, autolinks, strikethrough text, and suppression of emphasis markers inside words (useful for code identifiers). HTML output is validated against W3C standards for HTML 4.01 and XHTML 1.0. It has no dependencies outside the Go standard library, which makes it easy to include in any Go project. The recommended version is v2, available at the /v2 import path. Version 2 has a cleaner API and introduces a separate parsing step that produces an abstract syntax tree, making it easier to add custom rendering. A drawback noted in the README is that v2 is about 15% slower than v1. The older v1 remains available for projects that cannot update to the new API. A companion command-line tool called blackfriday-tool is available for converting Markdown files directly from the terminal without writing any Go code.
← russross on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.