From b7657be31cf553a9cf6852fce6630ea3ec1d4413 Mon Sep 17 00:00:00 2001 From: Matteo Nastasi Date: Thu, 19 Oct 2017 16:33:49 +0200 Subject: [PATCH] remove development print and allow spaces between triple backtick and syntax name in codeblock --- rest_framework/compat.py | 2 +- tests/test_description.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/rest_framework/compat.py b/rest_framework/compat.py index 239ef3def..ce821402e 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -244,7 +244,7 @@ if markdown is not None and pygments is not None: class CodeBlockPreprocessor(Preprocessor): pattern = re.compile( - r'^\s*``` ([^\n]+)\n(.+?)^\s*```', re.M|re.S) + r'^\s*``` *([^\n]+)\n(.+?)^\s*```', re.M|re.S) formatter = HtmlFormatter() diff --git a/tests/test_description.py b/tests/test_description.py index 3e9034344..4804168ab 100644 --- a/tests/test_description.py +++ b/tests/test_description.py @@ -112,7 +112,6 @@ class TestViewNamesAndDescriptions(TestCase): }] ```""" - print("MOCK:\n[%s]" % MockView().get_view_description()) assert MockView().get_view_description() == DESCRIPTION def test_view_description_can_be_empty(self):