Skip to content

Commit

Permalink
Fix #166, making sure we always cast raw tag override values to string (
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaudcolas committed Jan 25, 2022
1 parent 983ac1c commit 8b10c53
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 3 additions & 2 deletions pattern_library/monkey_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ def node_render(context):
context[target_var] = result
return ""

# Render result instead of the tag
return result
# Render result instead of the tag, as a string.
# See https://github.com/torchbox/django-pattern-library/issues/166.
return str(result)
elif default_html is not UNSPECIFIED:
# Render provided default;
# if no stub data supplied.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ tags:
empty_string:
raw: ''
none:
raw: 'None'
raw: None
zero:
raw: '0'
raw: 0
default_html_tag:
page.url:
raw: "example"
Expand All @@ -16,7 +16,6 @@ tags:
empty_string:
raw: ''
none:
raw: 'None'
raw: None
zero:
raw: '0'

raw: 0

0 comments on commit 8b10c53

Please sign in to comment.