diff --git a/helpdesk/models.py b/helpdesk/models.py index 7ef1b9c9..6a20091d 100644 --- a/helpdesk/models.py +++ b/helpdesk/models.py @@ -50,9 +50,9 @@ def format_time_spent(time_spent): class EscapeHtml(Extension): - def extendMarkdown(self, md, md_globals): - del md.preprocessors['html_block'] - del md.inlinePatterns['html'] + def extendMarkdown(self, md): + md.preprocessors.deregister('html_block') + md.inlinePatterns.deregister('html') def get_markdown(text): diff --git a/helpdesk/tests/test_markdown.py b/helpdesk/tests/test_markdown.py index edfb4dbd..7eeccb02 100644 --- a/helpdesk/tests/test_markdown.py +++ b/helpdesk/tests/test_markdown.py @@ -20,14 +20,14 @@ class MarkDown(SimpleTestCase): self.assertEqual(output_value, expected_value) def test_markdown_fenced_code(self): - expected_value = '

Title

\n
# import os\n
' + expected_value = '

Title

\n
# import os\n
' input_value = """ # Title ```python # import os ``` - """ + """ output_value = get_markdown(input_value) self.assertEqual(output_value, expected_value) diff --git a/requirements.txt b/requirements.txt index 3647bb5e..5093ae89 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ django-bootstrap4-form celery email-reply-parser akismet -markdown<3.0 +markdown beautifulsoup4 lxml simplejson