diff --git a/pattern_library/monkey_utils.py b/pattern_library/monkey_utils.py index d6ad07ba..ea1a132c 100644 --- a/pattern_library/monkey_utils.py +++ b/pattern_library/monkey_utils.py @@ -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. diff --git a/tests/templates/patterns/atoms/tags_test_atom/tags_test_atom.yaml b/tests/templates/patterns/atoms/tags_test_atom/tags_test_atom.yaml index f3b9c821..e2f7e592 100644 --- a/tests/templates/patterns/atoms/tags_test_atom/tags_test_atom.yaml +++ b/tests/templates/patterns/atoms/tags_test_atom/tags_test_atom.yaml @@ -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" @@ -16,7 +16,6 @@ tags: empty_string: raw: '' none: - raw: 'None' + raw: None zero: - raw: '0' - \ No newline at end of file + raw: 0