The default text blocks in Jade work well for simple text segments, but can become problematic for large segments with lots of formatting. That's where text-to-HTML filters such as Markdown excel.
Filters are Jade's way of supporting other text formatters within it. Jade is currently compatible with Stylus, Less, Markdown, CDATA, and CoffeeScript. Filter blocks are marked by a colon, followed by the name of the filter.
Note
Filters for Stylus, Less, Markdown, CDATA, and CoffeeScript, don't work right out of the box; you will need to install their respective packages for the filters to work in your code.
Let's find out how filters work using Markdown as an example.
First, install the markdown
Node package by executing the following command:
$ npm install markdown
With the package installed, you will be able to use Markdown in your code. The following is an example of using the Markdown syntax within the Markdown filter in a Jade view:
#content :markdown #Websites 1. [Wikipedia...