Skip to content

Commit 82475c2

Browse files
authored
Made relative URLs clickable as well. (#8464)
1 parent 5185cc9 commit 82475c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest_framework/templatetags/rest_framework.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def format_value(value):
218218
return template.render(context)
219219
elif isinstance(value, str):
220220
if (
221-
(value.startswith('http:') or value.startswith('https:')) and not
221+
(value.startswith('http:') or value.startswith('https:') or value.startswith('/')) and not
222222
re.search(r'\s', value)
223223
):
224224
return mark_safe('<a href="{value}">{value}</a>'.format(value=escape(value)))

0 commit comments

Comments
 (0)