Closed drgorb closed 8 years ago
Good idea. Do you know what Meteor package serves this well?
@pmuens I've had good luck with https://github.com/chuangbo/meteor-marked
@josephdburdick Thanks man! I'll look into it!
https://atmospherejs.com/meteor/markdown It says it's inbuilt.
Yes the package is an internal Meteor package, but that doesn't mean that all fields are parsed for markdown by default. If you try to include some markdown in a post it is displayed as plain text, so there still is some work that needs to be done in order to format posts using markdown.
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","
");
Found the above thing here- http://stackoverflow.com/a/17030896/4500248
Great find! Anyone up to implement this?
I tried doing it but then entire thing becomes markdown supported.
@zaverichintan Thank you for investigation. I think that this is a great addition (even if everything will be "markdownable".
Done.
in order to format one's post it would be nice to be able to use markdown. there is a meteor package for that