Ruby

Markdown libraries for Ruby — a pure-Ruby option plus fast bindings to C parsers. Back to the overview.

kramdown

A pure-Ruby parser with an extended syntax and multiple output formats.

pure Ruby
require 'kramdown'

html = Kramdown::Document.new('# Hello *world*').to_html

View kramdown →

Redcarpet

A fast, safe library binding the C Sundown parser; long used by GitHub.

fastC-backed
require 'redcarpet'

markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML)
html = markdown.render('# Hello *world*')

View Redcarpet →

CommonMarker

Ruby bindings to GitHub's cmark-gfm — CommonMark and GitHub Flavored Markdown.

CommonMarkGFM
require 'commonmarker'

html = Commonmarker.to_html('# Hello *world*')

View CommonMarker →