Created
March 25, 2012 09:35
-
-
Save jameswyse/2192568 to your computer and use it in GitHub Desktop.
Render markdown in node/express with variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You need to install 'node-markdown': `npm install node-markdown` | |
// In your app.configure section add 'md' to 'view options' ie: | |
app.set('view options', { layout: 'layouts/index', md: require("node-markdown").Markdown }) | |
// Then in your jade template you can use: | |
div!=md(text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was driving me crazy and I couldn't find anything on the net about how to do this, hopefully this will help someone!
Apparently the :markdown filter does not support variables as it's rendered at compile time