We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a4e0f03 commit 79b825eCopy full SHA for 79b825e
rest_framework/templatetags/rest_framework.py
@@ -1,6 +1,5 @@
1
from __future__ import absolute_import, unicode_literals
2
3
-import decimal
4
import re
5
6
from django import template
@@ -133,6 +132,8 @@ def format_value(value):
133
132
return mark_safe('<a href="{value}">{value}</a>'.format(value=escape(value)))
134
elif '@' in value and not re.search(r'\s', value):
135
return mark_safe('<a href="mailto:{value}">{value}</a>'.format(value=escape(value)))
+ elif '\n' in value:
136
+ return mark_safe('<pre>%s</pre>' % escape(value))
137
return six.text_type(value)
138
139
0 commit comments