Remove remaining use of markdown2. Enable markdown extras when rendering agendas. Fixes #3316. Commit ready for merge.

- Legacy-Id: 19358
This commit is contained in:
Robert Sparks 2021-09-08 17:54:40 +00:00
parent d7841409ca
commit 6ac363e3e2
3 changed files with 4 additions and 5 deletions

View file

@ -546,10 +546,10 @@ class MeetingTests(BaseMeetingTestCase):
filename = cont_disp_settings.get('filename', '').strip('"') filename = cont_disp_settings.get('filename', '').strip('"')
if filename.endswith('.md'): if filename.endswith('.md'):
for accept, cont_type, content in [ for accept, cont_type, content in [
('text/html,text/plain,text/markdown', 'text/html', '<li><p>More work items underway</p></li>'), ('text/html,text/plain,text/markdown', 'text/html', '<li>\n<p>More work items underway</p>\n</li>'),
('text/markdown,text/html,text/plain', 'text/markdown', '1. More work items underway'), ('text/markdown,text/html,text/plain', 'text/markdown', '1. More work items underway'),
('text/plain,text/markdown, text/html', 'text/plain', '1. More work items underway'), ('text/plain,text/markdown, text/html', 'text/plain', '1. More work items underway'),
('text/html', 'text/html', '<li><p>More work items underway</p></li>'), ('text/html', 'text/html', '<li>\n<p>More work items underway</p>\n</li>'),
('text/markdown', 'text/markdown', '1. More work items underway'), ('text/markdown', 'text/markdown', '1. More work items underway'),
('text/plain', 'text/plain', '1. More work items underway'), ('text/plain', 'text/plain', '1. More work items underway'),
]: ]:

View file

@ -14,7 +14,7 @@ import pytz
import re import re
import tarfile import tarfile
import tempfile import tempfile
import markdown2 import markdown
from calendar import timegm from calendar import timegm
from collections import OrderedDict, Counter, deque, defaultdict from collections import OrderedDict, Counter, deque, defaultdict
@ -261,7 +261,7 @@ def materials_document(request, document, num=None, ext=None):
content_type = content_type.replace('plain', 'markdown', 1) content_type = content_type.replace('plain', 'markdown', 1)
break; break;
elif atype[0] == 'text/html': elif atype[0] == 'text/html':
bytes = "<html>\n<head></head>\n<body>\n%s\n</body>\n</html>\n" % markdown2.markdown(bytes) bytes = "<html>\n<head></head>\n<body>\n%s\n</body>\n</html>\n" % markdown.markdown(bytes.decode(),extensions=['extra'])
content_type = content_type.replace('plain', 'html', 1) content_type = content_type.replace('plain', 'html', 1)
break; break;
elif atype[0] == 'text/plain': elif atype[0] == 'text/plain':

View file

@ -39,7 +39,6 @@ jwcrypto>=0.4.0 # for signed notifications
logging_tree>=1.8.1 logging_tree>=1.8.1
lxml>=3.4.0,<5 lxml>=3.4.0,<5
markdown>=3.3.4 markdown>=3.3.4
markdown2>=2.3.8
mock>=2.0.0 mock>=2.0.0
mypy>=0.782,<0.790 # Version requirements determined by django-stubs. mypy>=0.782,<0.790 # Version requirements determined by django-stubs.
mysqlclient>=1.3.13,!=2.0.2 mysqlclient>=1.3.13,!=2.0.2