-
Notifications
You must be signed in to change notification settings - Fork 62
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
Fenced code blocks do not receive pre tag #20
Comments
Hello, Same problem here. Even with 4 spaces and a blank line before the content, the code is not well formated. |
I think the owner of the package / repository is no longer maintaining it at all... There are open issues which have not received any feedback from him since 2014. |
Anyway, I found another solution :
So my templatetags/markdown_parser.py looks like this :
Hope it helps |
Thanks for the find, it is certainly helpful. However, processing markdown at the template level is not a good idea, furthermore, I do suggest reading the comments and links on your link, they elaborate on my above comments. |
Ok, thanks you for the tips, I'll fix my code and post back the final function here. PS : Your links lead to 404 when clicked, I had to c/p. |
It's the link you posted, I dragged it from your post into mine... hahaha, I guess it didn't work... I corrected it |
Here is my solution using the above information... this is the model.py file
... then in the template I just use There is no need for template tags. |
Waw, your solution is great ! Thank you for sharing ! Héhé, no need django-markdown-deux anymore. = P You rule ! |
Credit goes to you... you found the original post, I just read a little more into it... =) |
It works like a charm and in a secure way. We should create a new Repository. = P |
@contstantine AMazing solution, thanks! Does anyone know whether the "markdown" package is still supported in Python 3? |
for those who use the tag
so now my template can be used like this
|
Thank you!! it's displaying the code blocks, but the code section is weirdly wide, anyone else find this? |
Suppose I have a database entry where I have the following "fenced code block"
(triple back tick)
some fenced code block
another line
(triple back tick)
I also have the following model method in django models.py
Then the result being returned by the method is the following html code...
The
<pre>
tag is missing and it also displays inline rather than receiving the line break.The text was updated successfully, but these errors were encountered: