How does one actually use Markdown with Meteor

橙三吉。 提交于 2019-12-02 17:41:47

Everything inside markdown is considered markdown so make sure you do this:

{{#markdown}}{{>innerPreview}}{{/markdown}}

Instead of

{{#markdown}}
    {{>innerPreview}}
{{/markdown}}

The jquery wouldn't work because {{markdown}} is rendered before the DOM is put in place.

Instead use a session

Template.hello.markdown_data = function() {return Session.get("markdown_data")});

Then your template

{{#markdown}}{{{markdown_data}}}{{/markdown}}

Then store your markdown document in

Session.set("markdown_data","<your markdown data>");

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!