Created
September 20, 2014 12:15
-
-
Save Azeirah/8f10e6b4a28f0ab63a4f to your computer and use it in GitHub Desktop.
meteor helper
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
Template.previewNote.rerender = function () { | |
console.log(UI._templateInstance()); | |
var codes = UI._templateInstance().findAll("pre>code"); | |
for (var i = 0; i < codes.length; i++) { | |
hljs.highlightBlock(codes[i]); | |
} | |
}; |
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
<template name="previewNote"> | |
{{#if content}} | |
<div class="note preview"> | |
<h2 class="previewTitle">Preview</h2> | |
<hr> | |
<div class="middleNote"> | |
<h1>{{title}}</h1> | |
<p class='note-content'>{{#markdown}}{{content}}{{rerender}}{{/markdown}}</p> | |
</div> | |
<hr> | |
<ul class="tags bottomNote"> | |
{{#each tags}} | |
<li class="tag"><a>{{this}}</a></li> | |
{{/each}} | |
</ul> | |
</div> | |
{{/if}} | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment