Skip to content

Commit 8b10c53

Browse files
authored
Fix #166, making sure we always cast raw tag override values to string (#188)
1 parent 983ac1c commit 8b10c53

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Diff for: pattern_library/monkey_utils.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ def node_render(context):
7373
context[target_var] = result
7474
return ""
7575

76-
# Render result instead of the tag
77-
return result
76+
# Render result instead of the tag, as a string.
77+
# See https://github.com/torchbox/django-pattern-library/issues/166.
78+
return str(result)
7879
elif default_html is not UNSPECIFIED:
7980
# Render provided default;
8081
# if no stub data supplied.

Diff for: tests/templates/patterns/atoms/tags_test_atom/tags_test_atom.yaml

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ tags:
33
empty_string:
44
raw: ''
55
none:
6-
raw: 'None'
6+
raw: None
77
zero:
8-
raw: '0'
8+
raw: 0
99
default_html_tag:
1010
page.url:
1111
raw: "example"
@@ -16,7 +16,6 @@ tags:
1616
empty_string:
1717
raw: ''
1818
none:
19-
raw: 'None'
19+
raw: None
2020
zero:
21-
raw: '0'
22-
21+
raw: 0

0 commit comments

Comments
 (0)