Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown Support #105

Closed
davecom opened this issue Apr 10, 2016 · 2 comments
Closed

Markdown Support #105

davecom opened this issue Apr 10, 2016 · 2 comments

Comments

@davecom
Copy link

davecom commented Apr 10, 2016

This is more a "want to have" - but it would be incredible if with HTML templates there was the ability to auto-parse Markdown. For example if I have
<p> {{ dog }} </p>
in my template and dog contains a String which is in Markdown then the output in the template would be translated into HTML. Right now I'm planning to string together GRMustache with MMMarkdown via a Formatter or Rendering Object. Is that the best way to solve this issue?

@groue
Copy link
Owner

groue commented Apr 11, 2016

Hello @davecom. GRMustache will not have built-in support for markdown.

The simplest solution is to prepare your input, feed your templates with HTML generated by markdown, and use triple-mustache tags {{{ dog }}} to avoid escaping of this HTML.

A more involved solution could use, as you say, filters ({{ markdown(dog) }}) that return rendering objects (in order to explicitly manage the HTML content type) but I must first advise the simplest solution above.

@davecom
Copy link
Author

davecom commented Apr 13, 2016

Thanks for the reply and thanks for making a great library.

@davecom davecom closed this as completed Apr 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants