From 4260531b6cc91d8639c35c46a68fe104f7a3089b Mon Sep 17 00:00:00 2001 From: Jimmy Merrild Krag Date: Fri, 20 Apr 2018 15:51:27 +0200 Subject: [PATCH] Render descriptions (from help_text) using safe (#5869) To allow embedded HTML, and make consistent with other usages. Fixes #5715. --- rest_framework/templates/rest_framework/docs/link.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rest_framework/templates/rest_framework/docs/link.html b/rest_framework/templates/rest_framework/docs/link.html index c40a44733..0f92a8873 100644 --- a/rest_framework/templates/rest_framework/docs/link.html +++ b/rest_framework/templates/rest_framework/docs/link.html @@ -29,7 +29,7 @@ {% for field in link.fields|with_location:'path' %} - {{ field.name }}{% if field.required %} required{% endif %}{% if field.schema.description %}{{ field.schema.description }}{% endif %} + {{ field.name }}{% if field.required %} required{% endif %}{% if field.schema.description %}{{ field.schema.description|safe }}{% endif %} {% endfor %} @@ -43,7 +43,7 @@ {% for field in link.fields|with_location:'query' %} - {{ field.name }}{% if field.required %} required{% endif %}{% if field.schema.description %}{{ field.schema.description }}{% endif %} + {{ field.name }}{% if field.required %} required{% endif %}{% if field.schema.description %}{{ field.schema.description|safe }}{% endif %} {% endfor %} @@ -57,7 +57,7 @@ {% for field in link.fields|with_location:'header' %} - {{ field.name }}{% if field.required %} required{% endif %}{% if field.schema.description %}{{ field.schema.description }}{% endif %} + {{ field.name }}{% if field.required %} required{% endif %}{% if field.schema.description %}{{ field.schema.description|safe }}{% endif %} {% endfor %} @@ -71,7 +71,7 @@ {% for field in link.fields|with_location:'body' %} - {{ field.name }}{% if field.required %} required{% endif %}{% if field.schema.description %}{{ field.schema.description }}{% endif %} + {{ field.name }}{% if field.required %} required{% endif %}{% if field.schema.description %}{{ field.schema.description|safe }}{% endif %} {% endfor %} @@ -84,7 +84,7 @@ {% for field in link.fields|with_location:'form' %} - {{ field.name }}{% if field.required %} required{% endif %}{% if field.schema.description %}{{ field.schema.description }}{% endif %} + {{ field.name }}{% if field.required %} required{% endif %}{% if field.schema.description %}{{ field.schema.description|safe }}{% endif %} {% endfor %}