From 82475c232b531e075fe7666d808f9e68d052d35b Mon Sep 17 00:00:00 2001 From: Alessandro <9991341+alessandrosp@users.noreply.github.com> Date: Wed, 8 Jun 2022 23:03:00 +0900 Subject: [PATCH] Made relative URLs clickable as well. (#8464) --- rest_framework/templatetags/rest_framework.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/templatetags/rest_framework.py b/rest_framework/templatetags/rest_framework.py index db0e9c95c..ccd9430b4 100644 --- a/rest_framework/templatetags/rest_framework.py +++ b/rest_framework/templatetags/rest_framework.py @@ -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('{value}'.format(value=escape(value)))