Skip to content

Instantly share code, notes, and snippets.

@Azeirah
Created September 20, 2014 12:15
Show Gist options
  • Save Azeirah/8f10e6b4a28f0ab63a4f to your computer and use it in GitHub Desktop.
Save Azeirah/8f10e6b4a28f0ab63a4f to your computer and use it in GitHub Desktop.
meteor helper
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]);
}
};
<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