requirements: Upgrade Python-Markdown from 3.1.1 to 3.2.1.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg 2020-04-17 18:17:21 -07:00 committed by Tim Abbott
parent ddcb828349
commit 8e93175822
9 changed files with 32 additions and 32 deletions

View File

@ -179,7 +179,7 @@ stream_data.add_sub(amp_stream);
// works properly before markdown is initialized.
run_test('fenced_block_defaults', () => {
const input = '\n```\nfenced code\n```\n\nand then after\n';
const expected = '\n\n<div class="codehilite"><pre><span></span>fenced code\n</pre></div>\n\n\n\nand then after\n\n';
const expected = '\n\n<div class="codehilite"><pre><span></span><code>fenced code\n</code></pre></div>\n\n\n\nand then after\n\n';
const output = fenced_code.process_fenced_code(input);
assert.equal(output, expected);
});
@ -290,15 +290,15 @@ run_test('marked', () => {
{input: 'hello ***foo*** for you', expected: '<p>hello <strong><em>foo</em></strong> for you</p>'},
{input: '__hello__', expected: '<p>__hello__</p>'},
{input: '\n```\nfenced code\n```\n\nand then after\n',
expected: '<div class="codehilite"><pre><span></span>fenced code\n</pre></div>\n\n\n<p>and then after</p>'},
expected: '<div class="codehilite"><pre><span></span><code>fenced code\n</code></pre></div>\n\n\n<p>and then after</p>'},
{input: '\n```\n fenced code trailing whitespace \n```\n\nand then after\n',
expected: '<div class="codehilite"><pre><span></span> fenced code trailing whitespace\n</pre></div>\n\n\n<p>and then after</p>'},
expected: '<div class="codehilite"><pre><span></span><code> fenced code trailing whitespace\n</code></pre></div>\n\n\n<p>and then after</p>'},
{input: '* a\n* list \n* here',
expected: '<ul>\n<li>a</li>\n<li>list </li>\n<li>here</li>\n</ul>'},
{input: '\n```c#\nfenced code special\n```\n\nand then after\n',
expected: '<div class="codehilite"><pre><span></span>fenced code special\n</pre></div>\n\n\n<p>and then after</p>'},
expected: '<div class="codehilite"><pre><span></span><code>fenced code special\n</code></pre></div>\n\n\n<p>and then after</p>'},
{input: '\n```vb.net\nfenced code dot\n```\n\nand then after\n',
expected: '<div class="codehilite"><pre><span></span>fenced code dot\n</pre></div>\n\n\n<p>and then after</p>'},
expected: '<div class="codehilite"><pre><span></span><code>fenced code dot\n</code></pre></div>\n\n\n<p>and then after</p>'},
{input: 'Some text first\n* a\n* list \n* here\n\nand then after',
expected: '<p>Some text first</p>\n<ul>\n<li>a</li>\n<li>list </li>\n<li>here</li>\n</ul>\n<p>and then after</p>'},
{input: '1. an\n2. ordered \n3. list',

View File

@ -442,9 +442,9 @@ lxml==4.5.0 \
--hash=sha256:fe976a0f1ef09b3638778024ab9fb8cde3118f203364212c198f71341c0715ca
markdown-include==0.5.1 \
--hash=sha256:72a45461b589489a088753893bc95c5fa5909936186485f4ed55caa57d10250f
markdown==3.1.1 \
--hash=sha256:2e50876bcdd74517e7b71f3e7a76102050edec255b3983403f1a63e7c8a41e7a \
--hash=sha256:56a46ac655704b91e5b7e6326ce43d5ef72411376588afa1dd90e881b83c7e8c
markdown==3.2.1 \
--hash=sha256:90fee683eeabe1a92e149f7ba74e5ccdc81cd397bd6c516d93a8da0ef90b6902 \
--hash=sha256:e4795399163109457d4c5af2183fbe6b60326c17cfdf25ce6e7474c6624f725d
markupsafe==1.1.1 \
--hash=sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473 \
--hash=sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161 \

View File

@ -303,9 +303,9 @@ lxml==4.5.0 \
--hash=sha256:fe976a0f1ef09b3638778024ab9fb8cde3118f203364212c198f71341c0715ca
markdown-include==0.5.1 \
--hash=sha256:72a45461b589489a088753893bc95c5fa5909936186485f4ed55caa57d10250f
markdown==3.1.1 \
--hash=sha256:2e50876bcdd74517e7b71f3e7a76102050edec255b3983403f1a63e7c8a41e7a \
--hash=sha256:56a46ac655704b91e5b7e6326ce43d5ef72411376588afa1dd90e881b83c7e8c
markdown==3.2.1 \
--hash=sha256:90fee683eeabe1a92e149f7ba74e5ccdc81cd397bd6c516d93a8da0ef90b6902 \
--hash=sha256:e4795399163109457d4c5af2183fbe6b60326c17cfdf25ce6e7474c6624f725d
markupsafe==1.1.1 \
--hash=sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473 \
--hash=sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161 \

View File

@ -23,9 +23,9 @@ let stash_func = function (text) {
exports.wrap_code = function (code) {
// Trim trailing \n until there's just one left
// This mirrors how pygments handles code input
return '<div class="codehilite"><pre><span></span>' +
return '<div class="codehilite"><pre><span></span><code>' +
_.escape(code.replace(/^\n+|\n+$/g, '')) +
'\n</pre></div>\n';
'\n</code></pre></div>\n';
};
function wrap_quote(text) {

View File

@ -34,4 +34,4 @@ DESKTOP_WARNING_VERSION = "5.0.0"
# historical commits sharing the same major version, in which case a
# minor version bump suffices.
PROVISION_VERSION = '75.8'
PROVISION_VERSION = '76.0'

View File

@ -3,14 +3,14 @@
{
"name": "codeblock_hilite",
"input": "Hamlet said:\n~~~~.python \ndef speak(self):\n x = 1\n~~~~",
"expected_output": "<p>Hamlet said:</p>\n<div class=\"codehilite\"><pre><span></span><span class=\"k\">def</span> <span class=\"nf\">speak</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n <span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n</pre></div>",
"marked_expected_output": "<p>Hamlet said:</p>\n<div class=\"codehilite\"><pre><span></span>def speak(self):\n x = 1\n</pre></div>",
"expected_output": "<p>Hamlet said:</p>\n<div class=\"codehilite\"><pre><span></span><code><span class=\"k\">def</span> <span class=\"nf\">speak</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n <span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n</code></pre></div>",
"marked_expected_output": "<p>Hamlet said:</p>\n<div class=\"codehilite\"><pre><span></span><code>def speak(self):\n x = 1\n</code></pre></div>",
"text_content": "Hamlet said:\ndef speak(self):\n x = 1\n"
},
{
"name": "ampampamp",
"input": "& &amp; &amp;amp;\n~~~~\n& &amp; &amp;amp;\n~~~~\n & &amp; &amp;amp;",
"expected_output": "<p>&amp; &amp; &amp;amp;</p>\n<div class=\"codehilite\"><pre><span></span>&amp; &amp;amp; &amp;amp;amp;\n</pre></div>\n\n\n<div class=\"codehilite\"><pre><span></span>&amp; &amp;amp; &amp;amp;amp;\n</pre></div>"
"expected_output": "<p>&amp; &amp; &amp;amp;</p>\n<div class=\"codehilite\"><pre><span></span><code>&amp; &amp;amp; &amp;amp;amp;\n</code></pre></div>\n\n\n<div class=\"codehilite\"><pre><span></span><code>&amp; &amp;amp; &amp;amp;amp;\n</code></pre></div>"
},
{
"name": "basic_paragraph",
@ -21,7 +21,7 @@
{
"name": "codeblock_multiline",
"input": "Hamlet once said\n~~~~\ndef func():\n x = 1\n\n y = 2\n\n z = 3\n~~~~\nAnd all was good.",
"expected_output": "<p>Hamlet once said</p>\n<div class=\"codehilite\"><pre><span></span>def func():\n x = 1\n\n y = 2\n\n z = 3\n</pre></div>\n\n\n<p>And all was good.</p>",
"expected_output": "<p>Hamlet once said</p>\n<div class=\"codehilite\"><pre><span></span><code>def func():\n x = 1\n\n y = 2\n\n z = 3\n</code></pre></div>\n\n\n<p>And all was good.</p>",
"text_content": "Hamlet once said\ndef func():\n x = 1\n\n y = 2\n\n z = 3\n\n\n\nAnd all was good."
},
{
@ -32,7 +32,7 @@
{
"name": "codeblock_trailing_whitespace",
"input": "Hamlet once said\n~~~~\ndef func():\n x = 1\n\n y = 2\t\t\n\n z = 3 \n~~~~\nAnd all was good.",
"expected_output": "<p>Hamlet once said</p>\n<div class=\"codehilite\"><pre><span></span>def func():\n x = 1\n\n y = 2\n\n z = 3\n</pre></div>\n\n\n<p>And all was good.</p>",
"expected_output": "<p>Hamlet once said</p>\n<div class=\"codehilite\"><pre><span></span><code>def func():\n x = 1\n\n y = 2\n\n z = 3\n</code></pre></div>\n\n\n<p>And all was good.</p>",
"text_content": "Hamlet once said\ndef func():\n x = 1\n\n y = 2\n\n z = 3\n\n\n\nAnd all was good."
},
{
@ -44,13 +44,13 @@
{
"name": "codeblock_backticks",
"input": "\n```\nfenced code\n```\n\n```inline code```\n",
"expected_output": "<div class=\"codehilite\"><pre><span></span>fenced code\n</pre></div>\n\n\n<p><code>inline code</code></p>",
"expected_output": "<div class=\"codehilite\"><pre><span></span><code>fenced code\n</code></pre></div>\n\n\n<p><code>inline code</code></p>",
"text_content": "fenced code\n\n\n\ninline code"
},
{
"name": "hanging_multi_codeblock",
"input": "Hamlet said:\n~~~~\ndef speak(self):\n x = 1\n# Comment to make this code block longer to test Trac #1162\n~~~~\n\nThen he mentioned ````y = 4 + x**2```` and\n~~~~\ndef foobar(self):\n return self.baz()",
"expected_output": "<p>Hamlet said:</p>\n<div class=\"codehilite\"><pre><span></span>def speak(self):\n x = 1\n# Comment to make this code block longer to test Trac #1162\n</pre></div>\n\n\n<p>Then he mentioned <code>y = 4 + x**2</code> and</p>\n<div class=\"codehilite\"><pre><span></span>def foobar(self):\n return self.baz()\n</pre></div>",
"expected_output": "<p>Hamlet said:</p>\n<div class=\"codehilite\"><pre><span></span><code>def speak(self):\n x = 1\n# Comment to make this code block longer to test Trac #1162\n</code></pre></div>\n\n\n<p>Then he mentioned <code>y = 4 + x**2</code> and</p>\n<div class=\"codehilite\"><pre><span></span><code>def foobar(self):\n return self.baz()\n</code></pre></div>",
"text_content": "Hamlet said:\ndef speak(self):\n x = 1\n# Comment to make this code block longer to test Trac #1162\n\n\n\nThen he mentioned y = 4 + x**2 and\ndef foobar(self):\n return self.baz()\n"
},
{
@ -68,7 +68,7 @@
{
"name": "complexly_nested_quote",
"input": "I heard about this second hand...\n~~~ quote\n\nHe said:\n~~~ quote\nThe customer is complaining.\n\nThey looked at this code:\n``` \ndef hello(): print 'hello\n```\nThey would prefer:\n~~~\ndef hello()\n puts 'hello'\nend\n~~~\n\nPlease advise.\n~~~\n\nShe said:\n~~~ quote\nJust send them this:\n```\necho \"hello\n\"\n```\n~~~",
"expected_output": "<p>I heard about this second hand...</p>\n<blockquote>\n<p>He said:</p>\n<blockquote>\n<p>The customer is complaining.</p>\n<p>They looked at this code:</p>\n<div class=\"codehilite\"><pre><span></span>def hello(): print &#39;hello\n</pre></div>\n\n\n<p>They would prefer:</p>\n</blockquote>\n<p>def hello()<br>\n puts 'hello'<br>\nend</p>\n</blockquote>\n<p>Please advise.</p>\n<div class=\"codehilite\"><pre><span></span>She said:\n~~~ quote\nJust send them this:\n```\necho &quot;hello\n&quot;\n```\n</pre></div>",
"expected_output": "<p>I heard about this second hand...</p>\n<blockquote>\n<p>He said:</p>\n<blockquote>\n<p>The customer is complaining.</p>\n<p>They looked at this code:</p>\n<div class=\"codehilite\"><pre><span></span><code>def hello(): print &#39;hello\n</code></pre></div>\n\n\n<p>They would prefer:</p>\n</blockquote>\n<p>def hello()<br>\n puts 'hello'<br>\nend</p>\n</blockquote>\n<p>Please advise.</p>\n<div class=\"codehilite\"><pre><span></span><code>She said:\n~~~ quote\nJust send them this:\n```\necho &quot;hello\n&quot;\n```\n</code></pre></div>",
"text_content": "I heard about this second hand...\n> He said:\n> > The customer is complaining.\n> > They looked at this code:\n> > def hello(): print 'hello\n> > They would prefer:\n> def hello()\n> puts 'hello'\n> end\n\nPlease advise.\nShe said:\n~~~ quote\nJust send them this:\n```\necho \"hello\n\"\n```\n"
},
{
@ -113,13 +113,13 @@
{
"name": "dangerous_block",
"input": "``` one ```\n\n``` two ```\n\n~~~~\nx = 1",
"expected_output": "<p><code> one </code></p>\n<p><code> two </code></p>\n<div class=\"codehilite\"><pre><span></span>x = 1\n</pre></div>",
"expected_output": "<p><code> one </code></p>\n<p><code> two </code></p>\n<div class=\"codehilite\"><pre><span></span><code>x = 1\n</code></pre></div>",
"text_content": " one \n two \nx = 1\n"
},
{
"name": "four_space_code_block",
"input": " def foo(): pass",
"expected_output": "<div class=\"codehilite\"><pre><span></span>def foo(): pass\n</pre></div>",
"expected_output": "<div class=\"codehilite\"><pre><span></span><code>def foo(): pass\n</code></pre></div>",
"text_content": "def foo(): pass\n"
},
{
@ -237,7 +237,7 @@
{
"name": "ulist_codeblock",
"input": "~~~\nint x = 3\n* 4;\n~~~",
"expected_output": "<div class=\"codehilite\"><pre><span></span>int x = 3\n* 4;\n</pre></div>",
"expected_output": "<div class=\"codehilite\"><pre><span></span><code>int x = 3\n* 4;\n</code></pre></div>",
"text_content": "int x = 3\n* 4;\n"
},
{
@ -697,7 +697,7 @@
{
"name": "safe_html_in_code",
"input": "~~~\n<h1>stay normal</h1>",
"expected_output": "<div class=\"codehilite\"><pre><span></span>&lt;h1&gt;stay normal&lt;/h1&gt;\n</pre></div>",
"expected_output": "<div class=\"codehilite\"><pre><span></span><code>&lt;h1&gt;stay normal&lt;/h1&gt;\n</code></pre></div>",
"text_content": "<h1>stay normal<\/h1>\n"
},
{

View File

@ -1934,8 +1934,8 @@ class BugdownTest(ZulipTestCase):
" I am writing this message to test something. I am writing this message to test something."
converted = bugdown_convert(msg)
expected_output = '<p>Hello,</p>\n' + \
'<div class="codehilite"><pre><span></span>I am writing this message to test something. I am writing this message to test something.\n' + \
'</pre></div>'
'<div class="codehilite"><pre><span></span><code>I am writing this message to test something. I am writing this message to test something.\n' + \
'</code></pre></div>'
self.assertEqual(converted, expected_output)
realm = Realm.objects.create(string_id='code_block_processor_test')

View File

@ -988,7 +988,7 @@ class ImportExportTest(ZulipTestCase):
original_msg = Message.objects.get(content=special_characters_message, sender__realm=original_realm)
self.assertEqual(
original_msg.rendered_content,
('<div class="codehilite"><pre><span></span>&#39;\n</pre></div>\n\n\n'
('<div class="codehilite"><pre><span></span><code>&#39;\n</code></pre></div>\n\n\n'
'<p><span class="user-mention" data-user-id="%s">@Polonius</span></p>' %
(orig_polonius_user.id,))
)
@ -997,7 +997,7 @@ class ImportExportTest(ZulipTestCase):
imported_msg = Message.objects.get(content=special_characters_message, sender__realm=imported_realm)
self.assertEqual(
imported_msg.rendered_content,
('<div class="codehilite"><pre><span></span>\'\n</pre></div>\n'
('<div class="codehilite"><pre><span></span><code>\'\n</code></pre></div>\n'
'<p><span class="user-mention" data-user-id="%s">@Polonius</span></p>' %
(imported_polonius_user.id,))
)

View File

@ -102,8 +102,8 @@ footer
expected = ('header<h1id="this-is-a-heading">Thisisaheading.</h1><ol>'
'<li><p>Alistitemwithanindentedcodeblock:</p><divclass="codehilite">'
'<pre>indentedcodeblockwithmultiplelines</pre></div></li></ol>'
'<divclass="codehilite"><pre><span></span>'
'non-indentedcodeblockwithmultiplelines</pre></div>footer')
'<divclass="codehilite"><pre><span></span><code>'
'non-indentedcodeblockwithmultiplelines</code></pre></div>footer')
self.assertEqual(content_sans_whitespace, expected)
def test_custom_markdown_include_extension(self) -> None: