Skip to content

Commit 6ea6715

Browse files
committed
check for gist in raw html block before adding styles
1 parent 91336be commit 6ea6715

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tbx/core/templatetags/util_tags.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,12 @@ def ifinlist(value, list):
9595

9696
@register.filter(name="has_raw_html_block")
9797
def has_raw_html_block(value):
98-
if isinstance(value, StreamValue):
99-
return any(type(item.block) is blocks.RawHTMLBlock for item in value)
98+
if not isinstance(value, StreamValue):
99+
return False
100+
101+
for block in value._raw_data:
102+
if block["type"] == "raw_html" and "https://gist.github.com" in block["value"]:
103+
return True
100104
return False
101105

102106

0 commit comments

Comments
 (0)