Skip to content

Commit

Permalink
Made relative URLs clickable as well. (#8464)
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrosp authored Jun 8, 2022
1 parent 5185cc9 commit 82475c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rest_framework/templatetags/rest_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def format_value(value):
return template.render(context)
elif isinstance(value, str):
if (
(value.startswith('http:') or value.startswith('https:')) and not
(value.startswith('http:') or value.startswith('https:') or value.startswith('/')) and not
re.search(r'\s', value)
):
return mark_safe('<a href="{value}">{value}</a>'.format(value=escape(value)))
Expand Down

0 comments on commit 82475c2

Please sign in to comment.