O'Reilly logo

HTML5 Data and Services Cookbook by Mite Mitreski, Gorgi Kosev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Rendering Markdown

Markdown is a popular, lightweight markup language. The language is similar to Wiki markup (used on Wikipedia), with an emphasis on simplicity. Its main purpose is to enable users to write plain text and get stylized, formatted HTML output. As such, it is used by popular websites, such as Reddit, Stack Overflow, GitHub, as well as various forums as a replacement of the less intuitive BBCode format.

Markdown is the fastest way to enable formatted text input for our users without embedding a full-fledged HTML editor into the page. There are multiple libraries to render markdown; in this recipe, we're going to use the simple markdown-js script to render markdown in real time.

How to do it...

Rendering markdown is very simple. A minimal ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required