diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py
index 06cf91c..e0f350d 100644
--- a/django/template/defaultfilters.py
+++ b/django/template/defaultfilters.py
@@ -848,7 +848,10 @@ def json(value):
Thus, when using this filter between
-Remember that JSON marked as safe will contain unescaped strings and those need
-to be properly handled in the receiver.
+.. note::
+
+ Remember that JSON marked as safe will contain unescaped strings and those need
+ to be properly handled in the receiver.
.. templatefilter:: last
diff --git a/tests/regressiontests/templates/filters.py b/tests/regressiontests/templates/filters.py
index 262304b..644fb8b 100644
--- a/tests/regressiontests/templates/filters.py
+++ b/tests/regressiontests/templates/filters.py
@@ -108,8 +108,9 @@ def get_filter_tests():
# json filter #17419
'filter-json01': ("{{ data|json }}", {"data": {"hello": ["world", "universe"]}}, u'{"hello": ["world", "universe"]}'),
- 'filter-json02': ("{{ data|json|safe }}", {"data": {"foo": ""}}, u'{"foo": ""}'),
- 'filter-json03': ("{{ data|json|safe }}", {"data": ["foo", 'ba"r']}, u'["foo", "ba\\"r"]'),
+ 'filter-json02': ("{{ data|json }}", {"data": object()}, u''),
+ 'filter-json03': ("{{ data|json|safe }}", {"data": {"foo": ""}}, u'{"foo": ""}'),
+ 'filter-json04': ("{{ data|json|safe }}", {"data": ["foo", 'ba"r']}, u'["foo", "ba\\"r"]'),
# The make_list filter can destroy existing escaping, so the results are
# escaped.