diff --git a/rest_framework/compat.py b/rest_framework/compat.py index a085187aaf..ce821402e2 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -244,7 +244,7 @@ def pygments_css(style): class CodeBlockPreprocessor(Preprocessor): pattern = re.compile( - r'^\s*@@ (.+?) @@\s*(.+?)^\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 a97550ed8d..b3e8b0f8bd 100644 --- a/tests/test_description.py +++ b/tests/test_description.py @@ -26,12 +26,12 @@ # hash style header # -@@ json @@ +``` json [{ "alpha": 1, "beta: "this is a string" }] -@@""" +```""" # If markdown is installed we also test it's working # (and that our wrapped forces '=' to h2 and '-' to h3) @@ -47,12 +47,11 @@
@@ json @@ +
json
[{
"alpha": 1,
"beta: "this is a string"
-}]
-@@
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: