Skip to content

Instantly share code, notes, and snippets.

@avaly
Created July 14, 2014 09:55
Show Gist options
  • Save avaly/ed940eb3e13a1c4ac26f to your computer and use it in GitHub Desktop.
Save avaly/ed940eb3e13a1c4ac26f to your computer and use it in GitHub Desktop.
Jade Markdown filter with local variable
<html>
<body>
<div class="raw">Test `code` in _some_ awesome **markdown**</div>
<div class="md-local">Test `code` in _some_ awesome **markdown**
</div>
<div class="md-inline"><p>Test <code>code</code> in <em>some</em> awesome <strong>markdown</strong></p>
</div>
</body>
</html>
<html>
<body>
<div class="raw">Test `code` in _some_ awesome **markdown**</div>
<div class="md-local"><p>Test <code>code</code> in <em>some</em> awesome <strong>markdown</strong></p>
</div>
<div class="md-inline"><p>Test <code>code</code> in <em>some</em> awesome <strong>markdown</strong></p>
</div>
</body>
</html>
html
body
.raw= foo
.md-local
:markdown= foo
.md-inline
:markdown
Test `code` in _some_ awesome **markdown**
var fs = require('fs'),
jade = require('./index');
var src = fs.readFileSync('./test-case.jade', 'utf8');
var compiled = jade.compile(src, {
filename: 'test-case.jade',
pretty: true
});
console.log(compiled({
foo: 'Test `code` in _some_ awesome **markdown**'
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment