Filters
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: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access