From 299888184a2f3c5260b5a50a6c2d836d7f71b2ee Mon Sep 17 00:00:00 2001 From: Alessandro <9991341+alessandrosp@users.noreply.github.com> Date: Tue, 12 Apr 2022 23:58:39 +0000 Subject: [PATCH] Made relative URLs clickable as well. --- 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 db0e9c95c3..ccd9430b4e 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)))