-
Notifications
You must be signed in to change notification settings - Fork 153
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
[SOLVED] Render markdown to HTML in template #83
Comments
Most of the info how to properly setup markdownx is written in the docs. Please read it carefully. To be able to give you some tips, more info with your issue is needed. |
Thankyou @adi- I already read the setup, and it's already working in admin/model. Now I want to display it in template, but not working. It not rendered as HTML, just plain text. I usually just using this |
I just solved the issue, using template tag filter and
|
There are plenty of options to achieve this; most of which take the same approach as you've manually implemented yourself. We exemplify this in the documentations for the purpose of preview alongside the editor, but not for final stand-alone displays. Thanks for sharing anyway! |
Shouldn't there be a built-in way to render Markdown to HTML in Django templates? Since the Markdown is previewed live in the admin, I assumed that there was a way to render Markdown in any Django template using a filter. I feel like that should definitely be in the scope of this project. The documentation could definitely be improved to clarify that we have to implement this on our own. |
I completely agree with @denizdogan , this should be in the scope of the project and the documentation could be improved. There should be a section on how to render markdown in templates with a proper/complete example. |
Same as #77 |
I solved the problem in this way. It's probably the easiest way. model.py class Article(models.Model):
template.html {{ article.formatted_markdown|safe }} |
I worked for me, now is rendering ok, but the quotes are not working. |
For anyone coming here for a XSS safe solution: #163 |
I tried the above solutions without much luck. After much fiddling, I managed to pull it off and decided to write this up since I can see other users above also had the same issues as myself. @alzearafat |
Hi there
I'm new here, and I'm having an issue rendering markdownx to HTML. I use this tag :
But it's not working. And I cannot find in the docs (Maybe I missed it?)
Thank you!
The text was updated successfully, but these errors were encountered: