How to render HTML in Jade

Reading Time: < 1 minutes

Overview

Jade is a Node.js template engine that uses indentation as part of the syntax

By default, Jade buffers the output so we have to be explicit when we want unbuffered code

Solution

If content contains html and you want to render it, use != like this:

      
div!=content
      
    
Another example
      
p!= 'This code is' + ' <strong>not</strong> escaped!'
      
    

Reference

Photo by Pankaj Patel on Unsplash


About the author

Andrés Canavesi
Andrés Canavesi

Software Engineer with 15+ experience in software development, specialized in Salesforce, Java and Node.js.


Related posts


Leave a Reply

%d bloggers like this: