mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	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:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							ddcb828349
						
					
				
				
					commit
					8e93175822
				
			@@ -179,7 +179,7 @@ stream_data.add_sub(amp_stream);
 | 
				
			|||||||
// works properly before markdown is initialized.
 | 
					// works properly before markdown is initialized.
 | 
				
			||||||
run_test('fenced_block_defaults', () => {
 | 
					run_test('fenced_block_defaults', () => {
 | 
				
			||||||
    const input = '\n```\nfenced code\n```\n\nand then after\n';
 | 
					    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);
 | 
					    const output = fenced_code.process_fenced_code(input);
 | 
				
			||||||
    assert.equal(output, expected);
 | 
					    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 ***foo*** for you', expected: '<p>hello <strong><em>foo</em></strong> for you</p>'},
 | 
				
			||||||
        {input: '__hello__', expected: '<p>__hello__</p>'},
 | 
					        {input: '__hello__', expected: '<p>__hello__</p>'},
 | 
				
			||||||
        {input: '\n```\nfenced code\n```\n\nand then after\n',
 | 
					        {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',
 | 
					        {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',
 | 
					        {input: '* a\n* list \n* here',
 | 
				
			||||||
         expected: '<ul>\n<li>a</li>\n<li>list </li>\n<li>here</li>\n</ul>'},
 | 
					         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',
 | 
					        {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',
 | 
					        {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',
 | 
					        {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>'},
 | 
					         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',
 | 
					        {input: '1. an\n2. ordered \n3. list',
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -442,9 +442,9 @@ lxml==4.5.0 \
 | 
				
			|||||||
    --hash=sha256:fe976a0f1ef09b3638778024ab9fb8cde3118f203364212c198f71341c0715ca
 | 
					    --hash=sha256:fe976a0f1ef09b3638778024ab9fb8cde3118f203364212c198f71341c0715ca
 | 
				
			||||||
markdown-include==0.5.1 \
 | 
					markdown-include==0.5.1 \
 | 
				
			||||||
    --hash=sha256:72a45461b589489a088753893bc95c5fa5909936186485f4ed55caa57d10250f
 | 
					    --hash=sha256:72a45461b589489a088753893bc95c5fa5909936186485f4ed55caa57d10250f
 | 
				
			||||||
markdown==3.1.1 \
 | 
					markdown==3.2.1 \
 | 
				
			||||||
    --hash=sha256:2e50876bcdd74517e7b71f3e7a76102050edec255b3983403f1a63e7c8a41e7a \
 | 
					    --hash=sha256:90fee683eeabe1a92e149f7ba74e5ccdc81cd397bd6c516d93a8da0ef90b6902 \
 | 
				
			||||||
    --hash=sha256:56a46ac655704b91e5b7e6326ce43d5ef72411376588afa1dd90e881b83c7e8c
 | 
					    --hash=sha256:e4795399163109457d4c5af2183fbe6b60326c17cfdf25ce6e7474c6624f725d
 | 
				
			||||||
markupsafe==1.1.1 \
 | 
					markupsafe==1.1.1 \
 | 
				
			||||||
    --hash=sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473 \
 | 
					    --hash=sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473 \
 | 
				
			||||||
    --hash=sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161 \
 | 
					    --hash=sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161 \
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -303,9 +303,9 @@ lxml==4.5.0 \
 | 
				
			|||||||
    --hash=sha256:fe976a0f1ef09b3638778024ab9fb8cde3118f203364212c198f71341c0715ca
 | 
					    --hash=sha256:fe976a0f1ef09b3638778024ab9fb8cde3118f203364212c198f71341c0715ca
 | 
				
			||||||
markdown-include==0.5.1 \
 | 
					markdown-include==0.5.1 \
 | 
				
			||||||
    --hash=sha256:72a45461b589489a088753893bc95c5fa5909936186485f4ed55caa57d10250f
 | 
					    --hash=sha256:72a45461b589489a088753893bc95c5fa5909936186485f4ed55caa57d10250f
 | 
				
			||||||
markdown==3.1.1 \
 | 
					markdown==3.2.1 \
 | 
				
			||||||
    --hash=sha256:2e50876bcdd74517e7b71f3e7a76102050edec255b3983403f1a63e7c8a41e7a \
 | 
					    --hash=sha256:90fee683eeabe1a92e149f7ba74e5ccdc81cd397bd6c516d93a8da0ef90b6902 \
 | 
				
			||||||
    --hash=sha256:56a46ac655704b91e5b7e6326ce43d5ef72411376588afa1dd90e881b83c7e8c
 | 
					    --hash=sha256:e4795399163109457d4c5af2183fbe6b60326c17cfdf25ce6e7474c6624f725d
 | 
				
			||||||
markupsafe==1.1.1 \
 | 
					markupsafe==1.1.1 \
 | 
				
			||||||
    --hash=sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473 \
 | 
					    --hash=sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473 \
 | 
				
			||||||
    --hash=sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161 \
 | 
					    --hash=sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161 \
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,9 +23,9 @@ let stash_func = function (text) {
 | 
				
			|||||||
exports.wrap_code = function (code) {
 | 
					exports.wrap_code = function (code) {
 | 
				
			||||||
    // Trim trailing \n until there's just one left
 | 
					    // Trim trailing \n until there's just one left
 | 
				
			||||||
    // This mirrors how pygments handles code input
 | 
					    // 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, '')) +
 | 
					        _.escape(code.replace(/^\n+|\n+$/g, '')) +
 | 
				
			||||||
        '\n</pre></div>\n';
 | 
					        '\n</code></pre></div>\n';
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function wrap_quote(text) {
 | 
					function wrap_quote(text) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -34,4 +34,4 @@ DESKTOP_WARNING_VERSION = "5.0.0"
 | 
				
			|||||||
#   historical commits sharing the same major version, in which case a
 | 
					#   historical commits sharing the same major version, in which case a
 | 
				
			||||||
#   minor version bump suffices.
 | 
					#   minor version bump suffices.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
PROVISION_VERSION = '75.8'
 | 
					PROVISION_VERSION = '76.0'
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										24
									
								
								zerver/tests/fixtures/markdown_test_cases.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								zerver/tests/fixtures/markdown_test_cases.json
									
									
									
									
										vendored
									
									
								
							@@ -3,14 +3,14 @@
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
      "name": "codeblock_hilite",
 | 
					      "name": "codeblock_hilite",
 | 
				
			||||||
      "input": "Hamlet said:\n~~~~.python \ndef speak(self):\n    x = 1\n~~~~",
 | 
					      "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>",
 | 
					      "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>def speak(self):\n    x = 1\n</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"
 | 
					      "text_content": "Hamlet said:\ndef speak(self):\n    x = 1\n"
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      "name": "ampampamp",
 | 
					      "name": "ampampamp",
 | 
				
			||||||
      "input": "& & &amp;\n~~~~\n& & &amp;\n~~~~\n    & & &amp;",
 | 
					      "input": "& & &amp;\n~~~~\n& & &amp;\n~~~~\n    & & &amp;",
 | 
				
			||||||
      "expected_output": "<p>& & &amp;</p>\n<div class=\"codehilite\"><pre><span></span>& &amp; &amp;amp;\n</pre></div>\n\n\n<div class=\"codehilite\"><pre><span></span>& &amp; &amp;amp;\n</pre></div>"
 | 
					      "expected_output": "<p>& & &amp;</p>\n<div class=\"codehilite\"><pre><span></span><code>& &amp; &amp;amp;\n</code></pre></div>\n\n\n<div class=\"codehilite\"><pre><span></span><code>& &amp; &amp;amp;\n</code></pre></div>"
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      "name": "basic_paragraph",
 | 
					      "name": "basic_paragraph",
 | 
				
			||||||
@@ -21,7 +21,7 @@
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
      "name": "codeblock_multiline",
 | 
					      "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.",
 | 
					      "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."
 | 
					      "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",
 | 
					      "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.",
 | 
					      "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."
 | 
					      "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",
 | 
					      "name": "codeblock_backticks",
 | 
				
			||||||
      "input": "\n```\nfenced code\n```\n\n```inline code```\n",
 | 
					      "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"
 | 
					      "text_content": "fenced code\n\n\n\ninline code"
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      "name": "hanging_multi_codeblock",
 | 
					      "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()",
 | 
					      "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"
 | 
					      "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",
 | 
					      "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~~~",
 | 
					      "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 '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 "hello\n"\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 '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 "hello\n"\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"
 | 
					      "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",
 | 
					      "name": "dangerous_block",
 | 
				
			||||||
      "input": "``` one ```\n\n``` two ```\n\n~~~~\nx = 1",
 | 
					      "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"
 | 
					      "text_content": " one \n two \nx = 1\n"
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      "name": "four_space_code_block",
 | 
					      "name": "four_space_code_block",
 | 
				
			||||||
      "input": "    def foo(): pass",
 | 
					      "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"
 | 
					      "text_content": "def foo(): pass\n"
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@@ -237,7 +237,7 @@
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
      "name": "ulist_codeblock",
 | 
					      "name": "ulist_codeblock",
 | 
				
			||||||
      "input": "~~~\nint x = 3\n* 4;\n~~~",
 | 
					      "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"
 | 
					      "text_content": "int x = 3\n* 4;\n"
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@@ -697,7 +697,7 @@
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
      "name": "safe_html_in_code",
 | 
					      "name": "safe_html_in_code",
 | 
				
			||||||
      "input": "~~~\n<h1>stay normal</h1>",
 | 
					      "input": "~~~\n<h1>stay normal</h1>",
 | 
				
			||||||
      "expected_output": "<div class=\"codehilite\"><pre><span></span><h1>stay normal</h1>\n</pre></div>",
 | 
					      "expected_output": "<div class=\"codehilite\"><pre><span></span><code><h1>stay normal</h1>\n</code></pre></div>",
 | 
				
			||||||
      "text_content": "<h1>stay normal<\/h1>\n"
 | 
					      "text_content": "<h1>stay normal<\/h1>\n"
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1934,8 +1934,8 @@ class BugdownTest(ZulipTestCase):
 | 
				
			|||||||
              "    I am writing this message to test something. I am writing this message to test something."
 | 
					              "    I am writing this message to test something. I am writing this message to test something."
 | 
				
			||||||
        converted = bugdown_convert(msg)
 | 
					        converted = bugdown_convert(msg)
 | 
				
			||||||
        expected_output = '<p>Hello,</p>\n' +   \
 | 
					        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' +     \
 | 
					                          '<div class="codehilite"><pre><span></span><code>I am writing this message to test something. I am writing this message to test something.\n' +     \
 | 
				
			||||||
                          '</pre></div>'
 | 
					                          '</code></pre></div>'
 | 
				
			||||||
        self.assertEqual(converted, expected_output)
 | 
					        self.assertEqual(converted, expected_output)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        realm = Realm.objects.create(string_id='code_block_processor_test')
 | 
					        realm = Realm.objects.create(string_id='code_block_processor_test')
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -988,7 +988,7 @@ class ImportExportTest(ZulipTestCase):
 | 
				
			|||||||
        original_msg = Message.objects.get(content=special_characters_message, sender__realm=original_realm)
 | 
					        original_msg = Message.objects.get(content=special_characters_message, sender__realm=original_realm)
 | 
				
			||||||
        self.assertEqual(
 | 
					        self.assertEqual(
 | 
				
			||||||
            original_msg.rendered_content,
 | 
					            original_msg.rendered_content,
 | 
				
			||||||
            ('<div class="codehilite"><pre><span></span>'\n</pre></div>\n\n\n'
 | 
					            ('<div class="codehilite"><pre><span></span><code>'\n</code></pre></div>\n\n\n'
 | 
				
			||||||
             '<p><span class="user-mention" data-user-id="%s">@Polonius</span></p>' %
 | 
					             '<p><span class="user-mention" data-user-id="%s">@Polonius</span></p>' %
 | 
				
			||||||
             (orig_polonius_user.id,))
 | 
					             (orig_polonius_user.id,))
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
@@ -997,7 +997,7 @@ class ImportExportTest(ZulipTestCase):
 | 
				
			|||||||
        imported_msg = Message.objects.get(content=special_characters_message, sender__realm=imported_realm)
 | 
					        imported_msg = Message.objects.get(content=special_characters_message, sender__realm=imported_realm)
 | 
				
			||||||
        self.assertEqual(
 | 
					        self.assertEqual(
 | 
				
			||||||
            imported_msg.rendered_content,
 | 
					            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>' %
 | 
					             '<p><span class="user-mention" data-user-id="%s">@Polonius</span></p>' %
 | 
				
			||||||
             (imported_polonius_user.id,))
 | 
					             (imported_polonius_user.id,))
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -102,8 +102,8 @@ footer
 | 
				
			|||||||
        expected = ('header<h1id="this-is-a-heading">Thisisaheading.</h1><ol>'
 | 
					        expected = ('header<h1id="this-is-a-heading">Thisisaheading.</h1><ol>'
 | 
				
			||||||
                    '<li><p>Alistitemwithanindentedcodeblock:</p><divclass="codehilite">'
 | 
					                    '<li><p>Alistitemwithanindentedcodeblock:</p><divclass="codehilite">'
 | 
				
			||||||
                    '<pre>indentedcodeblockwithmultiplelines</pre></div></li></ol>'
 | 
					                    '<pre>indentedcodeblockwithmultiplelines</pre></div></li></ol>'
 | 
				
			||||||
                    '<divclass="codehilite"><pre><span></span>'
 | 
					                    '<divclass="codehilite"><pre><span></span><code>'
 | 
				
			||||||
                    'non-indentedcodeblockwithmultiplelines</pre></div>footer')
 | 
					                    'non-indentedcodeblockwithmultiplelines</code></pre></div>footer')
 | 
				
			||||||
        self.assertEqual(content_sans_whitespace, expected)
 | 
					        self.assertEqual(content_sans_whitespace, expected)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_custom_markdown_include_extension(self) -> None:
 | 
					    def test_custom_markdown_include_extension(self) -> None:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user