(u_u)

crystal入門:MarkdownをHTMLに変換する:[Markdown] self.to_html(text) : String:

Categories: [blog]
Tags: [crystal]

Markdown library parses Markdown text. It supports rendering to HTML text.

require "markdown"

text = "## This is title \n This is a [link](http://crystal-lang.org)"

Markdown.to_html(text)
# => <h2>This is title</h2>
# => <p>This is a <a href="http://crystal-lang.org">link</a></p>