diff options
| author | Tom Christie | 2012-01-28 14:38:06 +0000 |
|---|---|---|
| committer | Tom Christie | 2012-01-28 14:38:11 +0000 |
| commit | 22ee89f0f3fa295a265547336f837261bb919f34 (patch) | |
| tree | ec0bfd7d4ea24ecb06d1182b54c9f6dc17cc127c /djangorestframework/views.py | |
| parent | bbfa404e4679f4229e44fd7e641e62fdd2e7bdd5 (diff) | |
| download | django-rest-framework-22ee89f0f3fa295a265547336f837261bb919f34.tar.bz2 | |
Tidy up auto-escaping.
Diffstat (limited to 'djangorestframework/views.py')
| -rw-r--r-- | djangorestframework/views.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/djangorestframework/views.py b/djangorestframework/views.py index 88d81d25..32d2437c 100644 --- a/djangorestframework/views.py +++ b/djangorestframework/views.py @@ -36,6 +36,7 @@ def _remove_trailing_string(content, trailing): return content[:-len(trailing)] return content + def _remove_leading_indent(content): """ Remove leading indent from a block of text. @@ -50,6 +51,7 @@ def _remove_leading_indent(content): return re.sub(re.compile(whitespace_pattern, re.MULTILINE), '', content) return content + def _camelcase_to_spaces(content): """ Translate 'CamelCaseNames' to 'Camel Case Names'. @@ -161,9 +163,10 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView): def markup_description(self, description): if apply_markdown: - return apply_markdown(description) + description = apply_markdown(description) else: - return mark_safe(escape(description).replace('\n', '<br />')) + description = escape(description).replace('\n', '<br />') + return mark_safe(description) def http_method_not_allowed(self, request, *args, **kwargs): """ |
