A wrapper of marked - A markdown parser and compiler. Built for speed.
It provide a template helper markdown
as same as the official markdown, a window.marked
as same as official marked (except when
used with { weak: true }
), and a Package['chuangbo:marked'].marked
(always):
This package lets you use Markdown in your templates. It's easy: just put your markdown inside {{#markdown}} ... {{/markdown}} tags. You can still use all of the usual Meteor template features inside a Markdown block, such #each, and you still get reactivity.
Per the docs, the default options:
marked.setOptions({
renderer: new marked.Renderer(),
gfm: true,
tables: true,
breaks: false,
pedantic: false,
sanitize: false,
smartLists: true,
smartypants: false
});
you can also set an option highlight
with a function to handle syntax highlighting for code blocks.
Some Meteor syntax highlighting smart packages do this integration for you automatically.
e.g.
marked.setOptions({
highlight: function (code) { return hljs.highlightAuto(code).value; }
});