We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07631ae commit 010e131Copy full SHA for 010e131
tbx/core/templatetags/util_tags.py
@@ -3,7 +3,6 @@
3
4
from tbx.core.utils.models import SocialMediaSettings
5
from wagtail.blocks import StreamValue
6
-from wagtailmarkdown.blocks import MarkdownBlock
7
8
register = template.Library()
9
@@ -105,6 +104,9 @@ def has_raw_html_block(value):
105
104
106
@register.filter(name="has_markdown_block")
107
def has_markdown_block(value):
108
- if isinstance(value, StreamValue):
109
- return any(type(item.block) is MarkdownBlock for item in value)
110
- return False
+ if not isinstance(value, StreamValue):
+ return False
+
+ for block in value._raw_data:
111
+ if block["type"] == "markdown":
112
+ return True
0 commit comments