This is an automated email from the ASF dual-hosted git repository.

kentontaylor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git

commit bac4a0aca8b92c53aec771d8007488fda895fcc4
Author: Dave Brondsema <[email protected]>
AuthorDate: Tue Jan 18 13:11:58 2022 -0500

    [#8408] upgrade to markdown 3.1
---
 Allura/allura/tests/test_globals.py         | 34 +++++++++++++++++++++++++++--
 Allura/allura/tests/test_helpers.py         |  1 -
 Allura/allura/tests/unit/test_post_model.py |  5 +++--
 requirements.txt                            |  2 +-
 4 files changed, 36 insertions(+), 6 deletions(-)

diff --git a/Allura/allura/tests/test_globals.py 
b/Allura/allura/tests/test_globals.py
index b27fecb..51f10c0 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -517,9 +517,39 @@ def test_markdown_list_without_break():
 Regular text
 * first item
 * second item'''),
+        '<div class="markdown_content"><p>Regular text\n'  # no <br>
+        '* first item\n'  # no <br>
+        '* second item</p></div>'
+    )
+
+    assert_equal(
+        g.markdown.convert('''\
+Regular text
+- first item
+- second item'''),
+        '<div class="markdown_content"><p>Regular text<br/>\n'
+        '- first item<br/>\n'
+        '- second item</p></div>'
+    )
+
+    assert_equal(
+        g.markdown.convert('''\
+Regular text
++ first item
++ second item'''),
+        '<div class="markdown_content"><p>Regular text<br/>\n'
+        '+ first item<br/>\n'
+        '+ second item</p></div>'
+    )
+
+    assert_equal(
+        g.markdown.convert('''\
+Regular text
+1. first item
+2. second item'''),
         '<div class="markdown_content"><p>Regular text<br/>\n'
-        '<em> first item<br/>\n'
-        '</em> second item</p></div>'
+        '1. first item<br/>\n'
+        '2. second item</p></div>'
     )
 
 
diff --git a/Allura/allura/tests/test_helpers.py 
b/Allura/allura/tests/test_helpers.py
index 535b525..d57b598 100644
--- a/Allura/allura/tests/test_helpers.py
+++ b/Allura/allura/tests/test_helpers.py
@@ -270,7 +270,6 @@ def test_render_any_markup_plain():
 
 
 def test_render_any_markup_formatting():
-    # this is broken until markdown 3.1 fixes it again
     assert_equals(str(h.render_any_markup('README.md', '### foo\n'
                                           '    <script>alert(1)</script> 
bar')),
                   '<div class="markdown_content"><h3 id="foo">foo</h3>\n'
diff --git a/Allura/allura/tests/unit/test_post_model.py 
b/Allura/allura/tests/unit/test_post_model.py
index e99e673..214c831 100644
--- a/Allura/allura/tests/unit/test_post_model.py
+++ b/Allura/allura/tests/unit/test_post_model.py
@@ -47,10 +47,11 @@ class TestPostModel(WithDatabase):
     def test_activity_extras(self):
         self.post.text = """\
 This is a **bold thing**, 40 chars here.
+
 * Here's the first item in our list.
 * And here's the second item.""" + ','.join(map(str, list(range(200))))
         assert 'allura_id' in self.post.activity_extras
         summary = self.post.activity_extras['summary']
         assert summary.startswith("This is a bold thing, 40 chars here. Here's 
the first item in our list. "
-                                  "And here's the second item.")
-        assert summary.endswith('125,126,127...')
+                                  "And here's the second item."), summary  # 
no formatting/HTML
+        assert summary.endswith('125,126,127...'), summary  # it gets truncated
diff --git a/requirements.txt b/requirements.txt
index 8f0ec4f..d2ed980 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -73,7 +73,7 @@ iso8601==0.1.16
     # via colander
 jinja2==3.0.2
     # via -r requirements.in
-markdown==3.0.1
+markdown==3.1.1
     # via
     #   -r requirements.in
     #   markdown-checklist

Reply via email to