You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2022/02/09 18:12:14 UTC

[allura] branch db/8408 updated (cce6a78 -> 3d467f0)

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

brondsem pushed a change to branch db/8408
in repository https://gitbox.apache.org/repos/asf/allura.git.


    from cce6a78  [#8408] raise markdown limits now
     new 197b8b1  fixup! [#8408] start Markdown upgrade, simple cleanups
     new 3d467f0  fixup! [#8408] upgrade to markdown 3.1

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Allura/allura/tests/test_globals.py         | 47 +++++++++++++++++++++++++++++
 Allura/allura/tests/unit/test_post_model.py |  5 +--
 2 files changed, 50 insertions(+), 2 deletions(-)

[allura] 01/02: fixup! [#8408] start Markdown upgrade, simple cleanups

Posted by br...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8408
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 197b8b13aec02b87479ea83d6c60909850e5a50a
Author: Dave Brondsema <db...@slashdotmedia.com>
AuthorDate: Wed Feb 9 12:55:33 2022 -0500

    fixup! [#8408] start Markdown upgrade, simple cleanups
---
 Allura/allura/tests/test_globals.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/Allura/allura/tests/test_globals.py b/Allura/allura/tests/test_globals.py
index 65a5bd9..3268332 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -504,6 +504,23 @@ def foo(): pass
     )
 
 
+def test_markdown_list_without_break():
+    # this is not a valid way to make a list in original Markdown or python-markdown
+    #   https://github.com/Python-Markdown/markdown/issues/874
+    # it is valid in the CommonMark spec https://spec.commonmark.org/0.30/#lists
+    # TODO: try https://github.com/adamb70/mdx-breakless-lists
+    #       or https://gitlab.com/ayblaq/prependnewline
+    assert_equal(
+        g.markdown.convert('''\
+Regular text
+* first item
+* second item'''),
+        '<div class="markdown_content"><p>Regular text<br/>\n'
+        '<em> first item<br/>\n'
+        '</em> second item</p></div>'
+    )
+
+
 def test_markdown_autolink():
     tgt = 'http://everything2.com/?node=nate+oostendorp'
     s = g.markdown.convert('This is %s' % tgt)

[allura] 02/02: fixup! [#8408] upgrade to markdown 3.1

Posted by br...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8408
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 3d467f099aef88799edf6f723c797e287b8ab2ce
Author: Dave Brondsema <db...@slashdotmedia.com>
AuthorDate: Wed Feb 9 13:11:46 2022 -0500

    fixup! [#8408] upgrade to markdown 3.1
---
 Allura/allura/tests/test_globals.py         | 34 +++++++++++++++++++++++++++--
 Allura/allura/tests/unit/test_post_model.py |  5 +++--
 2 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/Allura/allura/tests/test_globals.py b/Allura/allura/tests/test_globals.py
index 3268332..fa9572f 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -515,9 +515,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/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