Skip to content

Commit 7eb01dd

Browse files
committed
Fix markdown rendering for excerpts - apply markdown filter before striptags
1 parent 8a81bd7 commit 7eb01dd

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

portfolio/templates/portfolio/includes/post_slug.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{% load static %}
2+
{% load markdown_extras %}
23

34
<li class="w-full">
45
<article>
@@ -17,7 +18,7 @@
1718
</h3>
1819
<p class="text-xs sm:text-sm text-gray-600 dark:text-gray-400 mt-2
1920
line-clamp-3 break-words leading-relaxed">
20-
{{ post.excerpt|truncatewords:20|striptags }}
21+
{{ post.excerpt|markdown|striptags|truncatewords:20 }}
2122
</p>
2223
</div>
2324
</a>

portfolio/templates/portfolio/stored_post.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% extends "base.html" %}
22

33
{% load static %}
4+
{% load markdown_extras %}
45

56
{% block title %}Saved Posts{% endblock %}
67

@@ -35,7 +36,7 @@ <h3 class="text-base sm:text-lg font-semibold text-gray-900 dark:text-gray-100 b
3536
</h3>
3637
{% if post.excerpt %}
3738
<p class="text-sm text-gray-600 dark:text-gray-400 mt-2 line-clamp-2">
38-
{{ post.excerpt|truncatewords:20|striptags }}
39+
{{ post.excerpt|markdown|striptags|truncatewords:20 }}
3940
</p>
4041
{% endif %}
4142
</a>

0 commit comments

Comments
 (0)