2014-01-17 21:08:45 +01:00
{
"regular_tests" : [
2021-09-15 00:10:28 +02:00
{
"name" : "empty" ,
"input" : "" ,
"expected_output" : "" ,
"text_content" : ""
} ,
2014-01-17 21:08:45 +01:00
{
2021-04-22 23:15:05 +02:00
"name" : "codeblock_hilite_python" ,
2014-03-06 00:05:49 +01:00
"input" : "Hamlet said:\n~~~~.python \ndef speak(self):\n x = 1\n~~~~" ,
2020-09-15 16:29:35 +02:00
"expected_output" : "<p>Hamlet said:</p>\n<div class=\"codehilite\" data-code-language=\"Python\"><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>" ,
2020-09-06 11:52:11 +02:00
"marked_expected_output" : "<p>Hamlet said:</p>\n<div class=\"codehilite\" data-code-language=\"Python\"><pre><span></span><code>def speak(self):\n x = 1\n</code></pre></div>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "Hamlet said:\ndef speak(self):\n x = 1\n"
2014-01-17 21:08:45 +01:00
} ,
2020-09-15 06:43:56 +02:00
{
2021-04-22 23:15:05 +02:00
"name" : "codeblock_hilite_invented_language" ,
2020-09-15 06:43:56 +02:00
"input" : "``` inventedlanguage\ndef speak(self):\n x = 1\n```" ,
"expected_output" : "<div class=\"codehilite\" data-code-language=\"inventedlanguage\"><pre><span></span><code>def speak(self):\n x = 1\n</code></pre></div>" ,
2020-09-06 11:52:11 +02:00
"text_content" : "def speak(self):\n x = 1\n"
} ,
{
"name" : "codeblock_canonicalize_lang_alias" ,
"input" : "``` py2\ndef speak(self):\n x = 1\n```" ,
"expected_output" : "<div class=\"codehilite\" data-code-language=\"Python 2.x\"><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" : "<div class=\"codehilite\" data-code-language=\"Python 2.x\"><pre><span></span><code>def speak(self):\n x = 1\n</code></pre></div>" ,
2020-09-15 06:43:56 +02:00
"text_content" : "def speak(self):\n x = 1\n"
} ,
2019-12-13 01:38:49 +01:00
{
"name" : "ampampamp" ,
"input" : "& & &amp;\n~~~~\n& & &amp;\n~~~~\n & & &amp;" ,
2020-10-19 04:49:17 +02:00
"expected_output" : "<p>& & &amp;</p>\n<div class=\"codehilite\"><pre><span></span><code>& &amp; &amp;amp;\n</code></pre></div>\n<div class=\"codehilite\"><pre><span></span><code>& &amp; &amp;amp;\n</code></pre></div>"
2019-12-13 01:38:49 +01:00
} ,
2014-01-17 21:08:45 +01:00
{
"name" : "basic_paragraph" ,
"input" : "test_input" ,
"expected_output" : "<p>test_input</p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "test_input"
2014-01-17 21:08:45 +01:00
} ,
{
"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." ,
2020-10-19 04:49:17 +02:00
"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<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\nAnd all was good."
2014-01-17 21:08:45 +01:00
} ,
2017-12-10 09:01:37 +01:00
{
2021-04-22 23:15:05 +02:00
"name" : "normal_text_test" ,
2017-12-10 09:01:37 +01:00
"input" : "it's lunch time" ,
"expected_output" : "<p>it's lunch time</p>"
} ,
2017-03-20 18:54:00 +01:00
{
"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." ,
2020-10-19 04:49:17 +02:00
"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<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\nAnd all was good."
2017-03-20 18:54:00 +01:00
} ,
2017-11-22 02:27:19 +01:00
{
"name" : "inline_code_spaces" ,
"input" : "` outer ` ``` space ```" ,
"expected_output" : "<p><code> outer </code> <code> space </code></p>" ,
"text_content" : " outer space "
} ,
2020-02-14 00:09:22 +01:00
{
"name" : "inline_code_html_entities" ,
"input" : "`< >`" ,
"expected_output" : "<p><code><&nbsp;></code></p>" ,
"text_content" : "< >"
} ,
2014-01-17 21:08:45 +01:00
{
"name" : "codeblock_backticks" ,
"input" : "\n```\nfenced code\n```\n\n```inline code```\n" ,
2020-10-19 04:49:17 +02:00
"expected_output" : "<div class=\"codehilite\"><pre><span></span><code>fenced code\n</code></pre></div>\n<p><code>inline code</code></p>" ,
"text_content" : "fenced code\n\ninline code"
2014-01-17 21:08:45 +01:00
} ,
{
"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()" ,
2020-10-19 04:49:17 +02:00
"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<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\nThen he mentioned y = 4 + x**2 and\ndef foobar(self):\n return self.baz()\n"
2014-01-17 21:08:45 +01:00
} ,
{
2021-04-22 23:15:05 +02:00
"name" : "fenced_normal_quote" ,
2014-01-17 21:08:45 +01:00
"input" : "Hamlet said:\n~~~ quote\nTo be or **not** to be.\n\nThat is the question\n~~~" ,
"expected_output" : "<p>Hamlet said:</p>\n<blockquote>\n<p>To be or <strong>not</strong> to be.</p>\n<p>That is the question</p>\n</blockquote>" ,
2024-06-12 17:13:34 +02:00
"text_content" : "Hamlet said:\n[…]"
2014-01-17 21:08:45 +01:00
} ,
{
"name" : "fenced_nested_quote" ,
"input" : "Hamlet said:\n~~~ quote\nPolonius said:\n> This above all: to thine ownself be true,\nAnd it must follow, as the night the day,\nThou canst not then be false to any man.\n\nWhat good advice!\n~~~" ,
"expected_output" : "<p>Hamlet said:</p>\n<blockquote>\n<p>Polonius said:</p>\n<blockquote>\n<p>This above all: to thine ownself be true,<br>\nAnd it must follow, as the night the day,<br>\nThou canst not then be false to any man.</p>\n</blockquote>\n<p>What good advice!</p>\n</blockquote>" ,
2024-06-12 17:13:34 +02:00
"text_content" : "Hamlet said:\n[…]"
2014-01-17 21:08:45 +01:00
} ,
{
2021-04-22 23:15:05 +02:00
"name" : "fenced_complexly_nested_quote" ,
2014-01-27 23:21:48 +01:00
"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~~~" ,
2020-10-19 04:49:17 +02:00
"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<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>" ,
2024-06-12 17:13:34 +02:00
"text_content" : "I heard about this second hand...\n[…]Please advise.\nShe said:\n~~~ quote\nJust send them this:\n```\necho \"hello\n\"\n```\n"
2014-01-17 21:08:45 +01:00
} ,
2017-11-21 07:21:26 +01:00
{
"name" : "fenced_quotes_inside_mathblock" ,
"input" : "```math\n````js\nvar x;\n````\n```" ,
2021-11-05 01:09:45 +01:00
"expected_output" : "<p><span class=\"katex-display\"><span class=\"katex\"><span class=\"katex-mathml\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi mathvariant=\"normal\">‘ </mi><mi mathvariant=\"normal\">‘ </mi><mi mathvariant=\"normal\">‘ </mi><mi mathvariant=\"normal\">‘ </mi><mi>j</mi><mi>s</mi><mi>v</mi><mi>a</mi><mi>r</mi><mi>x</mi><mo separator=\"true\">;</mo><mi mathvariant=\"normal\">‘ </mi><mi mathvariant=\"normal\">‘ </mi><mi mathvariant=\"normal\">‘ </mi><mi mathvariant=\"normal\">‘ </mi></mrow><annotation encoding=\"application/x-tex\">````js\nvar x;\n````</annotation></semantics></math></span><span class=\"katex-html\" aria-hidden=\"true\"><span class=\"base\"><span class=\"strut\" style=\"height:0.8889em;vertical-align:-0.1944em;\"></span><span class=\"mord\">‘ ‘ ‘ ‘ </span><span class=\"mord mathnormal\" style=\"margin-right:0.05724em;\">j</span><span class=\"mord mathnormal\">s</span><span class=\"mord mathnormal\" style=\"margin-right:0.03588em;\">v</span><span class=\"mord mathnormal\">a</span><span class=\"mord mathnormal\" style=\"margin-right:0.02778em;\">r</span><span class=\"mord mathnormal\">x</span><span class=\"mpunct\">;</span><span class=\"mspace\" style=\"margin-right:0.1667em;\"></span><span class=\"mord\">‘ ‘ ‘ ‘ </span></span></span></span></span></p>"
2017-11-21 07:21:26 +01:00
} ,
2017-11-17 11:02:44 +01:00
{
"name" : "empty_single_blockquote" ,
"input" : ">" ,
"expected_output" : "<p>></p>"
} ,
{
"name" : "empty_multiple_blockquote" ,
"input" : ">>>>>" ,
"expected_output" : "<blockquote>\n<blockquote>\n<blockquote>\n<blockquote>\n<p>></p>\n</blockquote>\n</blockquote>\n</blockquote>\n</blockquote>"
} ,
{
"name" : "non_empty_blockquote" ,
"input" : ">\n>\ntext" ,
"expected_output" : "<blockquote>\n<p>text</p>\n</blockquote>"
} ,
2020-10-30 20:10:29 +01:00
{
2021-04-22 23:15:05 +02:00
"name" : "multiple_blockquote_with_angular_bracket" ,
"input" : "> Hello World!\n\n> Hello Universe!" ,
"expected_output" : "<blockquote>\n<p>Hello World!</p>\n</blockquote>\n<blockquote>\n<p>Hello Universe!</p>\n</blockquote>"
2020-10-30 20:10:29 +01:00
} ,
{
2021-04-22 23:15:05 +02:00
"name" : "multiple_blockquote_with_backticks_and_angular_bracket" ,
2020-10-30 20:10:29 +01:00
"input" : "```quote\nText in\nmultiple lines.\n```\n\n> Text in a single line." ,
"expected_output" : "<blockquote>\n<p>Text in<br>\nmultiple lines.</p>\n</blockquote>\n<blockquote>\n<p>Text in a single line.</p>\n</blockquote>"
} ,
{
"name" : "multiple_blockquote_with_quote_and_reply" ,
"input" : "Hamlet said:\n~~~quote\nCan we talk ?\n~~~\n> Yes !!\n\nWelcome to Open Source." ,
"expected_output" : "<p>Hamlet said:</p>\n<blockquote>\n<p>Can we talk ?</p>\n</blockquote>\n<blockquote>\n<p>Yes !!</p>\n</blockquote>\n<p>Welcome to Open Source.</p>" ,
2024-06-12 17:13:34 +02:00
"text_content" : "Hamlet said:\n[…]\nWelcome to Open Source."
2020-10-30 20:10:29 +01:00
} ,
2017-07-18 20:24:18 +02:00
{
"name" : "fenced_quote_with_hashtag" ,
2019-07-31 08:04:32 +02:00
"input" : "```quote\n# line 1\n#line 2\n```" ,
"expected_output" : "<blockquote>\n<h1>line 1</h1>\n<p>#line 2</p>\n</blockquote>" ,
"text_content" : "> line 1\n> #line 2\n"
2017-07-18 20:24:18 +02:00
} ,
2020-01-02 02:22:01 +01:00
{
"name" : "fenced_quote_and_list" ,
"input" : "Before:\n* One.\n* Two.\n\n```quote\nLists should work after a quote\n```\n\nAfter:\n* One.\n* Two." ,
"expected_output" : "<p>Before:</p>\n<ul>\n<li>One.</li>\n<li>Two.</li>\n</ul>\n<blockquote>\n<p>Lists should work after a quote</p>\n</blockquote>\n<p>After:</p>\n<ul>\n<li>One.</li>\n<li>Two.</li>\n</ul>" ,
2024-06-12 17:13:34 +02:00
"text_content" : "Before:\n\nOne.\nTwo.\n\n[…]After:\n\nOne.\nTwo.\n"
2020-01-02 02:22:01 +01:00
} ,
2014-01-17 21:08:45 +01:00
{
2021-04-22 23:15:05 +02:00
"name" : "dangerous_block_having_x" ,
2014-01-17 21:08:45 +01:00
"input" : "xxxxxx xxxxx xxxxxxxx xxxx. x xxxx xxxxxxxxxx:\n\n```\"xxxx xxxx\\xxxxx\\xxxxxx\"```\n\nxxx xxxx xxxxx:```xx.xxxxxxx(x'^xxxx$', xx.xxxxxxxxx)```\n\nxxxxxxx'x xxxx xxxxxxxxxx ```'xxxx'```, xxxxx xxxxxxxxx xxxxx ^ xxx $ xxxxxx xxxxx xxxxxxxxxxxx xxx xxxx xx x xxxx xx xxxx xx xxx xxxxx xxxxxx?" ,
"expected_output" : "<p>xxxxxx xxxxx xxxxxxxx xxxx. x xxxx xxxxxxxxxx:</p>\n<p><code>\"xxxx xxxx\\xxxxx\\xxxxxx\"</code></p>\n<p>xxx xxxx xxxxx:<code>xx.xxxxxxx(x'^xxxx$', xx.xxxxxxxxx)</code></p>\n<p>xxxxxxx'x xxxx xxxxxxxxxx <code>'xxxx'</code>, xxxxx xxxxxxxxx xxxxx ^ xxx $ xxxxxx xxxxx xxxxxxxxxxxx xxx xxxx xx x xxxx xx xxxx xx xxx xxxxx xxxxxx?</p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "xxxxxx xxxxx xxxxxxxx xxxx. x xxxx xxxxxxxxxx:\n\"xxxx xxxx\\xxxxx\\xxxxxx\"\nxxx xxxx xxxxx:xx.xxxxxxx(x'^xxxx$', xx.xxxxxxxxx)\nxxxxxxx'x xxxx xxxxxxxxxx 'xxxx', xxxxx xxxxxxxxx xxxxx ^ xxx $ xxxxxx xxxxx xxxxxxxxxxxx xxx xxxx xx x xxxx xx xxxx xx xxx xxxxx xxxxxx?"
2014-01-17 21:08:45 +01:00
} ,
{
2021-04-22 23:15:05 +02:00
"name" : "dangerous_block_having_backticks" ,
2014-01-17 21:08:45 +01:00
"input" : "``` one ```\n\n``` two ```\n\n~~~~\nx = 1" ,
2020-04-18 03:17:21 +02:00
"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>" ,
2017-11-22 02:27:19 +01:00
"text_content" : " one \n two \nx = 1\n"
2014-01-17 21:08:45 +01:00
} ,
2017-03-26 21:14:05 +02:00
{
"name" : "four_space_code_block" ,
"input" : " def foo(): pass" ,
2020-04-18 03:17:21 +02:00
"expected_output" : "<div class=\"codehilite\"><pre><span></span><code>def foo(): pass\n</code></pre></div>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "def foo(): pass\n"
2017-03-26 21:14:05 +02:00
} ,
{
"name" : "two_space_not_code_block" ,
"input" : " notcode" ,
"expected_output" : "<p>notcode</p>" ,
2017-10-06 23:16:29 +02:00
"marked_expected_output" : "<p> notcode</p>" ,
"text_content" : "notcode"
2017-03-26 21:14:05 +02:00
} ,
2019-07-31 08:04:32 +02:00
{
"name" : "hashheading_enabled" ,
2021-05-10 07:02:14 +02:00
"input" : "# Hello world" ,
"expected_output" : "<h1>Hello world</h1>"
2019-07-31 08:04:32 +02:00
} ,
{
"name" : "hashheading_needs_spaces" ,
2021-05-10 07:02:14 +02:00
"input" : "#Hello world" ,
"expected_output" : "<p>#Hello world</p>"
2019-07-31 08:04:32 +02:00
} ,
{
"name" : "hashheading_multiple_spaces" ,
2021-05-10 07:02:14 +02:00
"input" : "# Hello world" ,
"expected_output" : "<h1>Hello world</h1>"
2019-07-31 08:04:32 +02:00
} ,
{
"name" : "hashheading_6_levels" ,
2021-05-10 07:02:14 +02:00
"input" : "###### Hello world" ,
"expected_output" : "<h6>Hello world</h6>"
2019-07-31 08:04:32 +02:00
} ,
{
"name" : "hashheading_7_levels" ,
2021-05-10 07:02:14 +02:00
"input" : "####### Hello world" ,
"expected_output" : "<p>####### Hello world</p>"
2019-07-31 08:04:32 +02:00
} ,
2019-02-04 11:22:13 +01:00
{
"name" : "reference_links_disabled" ,
"input" : "Hello [world]\n\n[world]: https://google.com" ,
2020-05-09 03:44:56 +02:00
"expected_output" : "<p>Hello [world]</p>\n<p>[world]: <a href=\"https://google.com\">https://google.com</a></p>"
2019-02-04 11:22:13 +01:00
} ,
{
"name" : "reference_links_disabled_2" ,
"input" : "Hello [world][ref-name]\n\n[ref-name]: https://google.com" ,
2020-05-09 03:44:56 +02:00
"expected_output" : "<p>Hello [world][ref-name]</p>\n<p>[ref-name]: <a href=\"https://google.com\">https://google.com</a></p>"
2019-02-04 11:22:13 +01:00
} ,
2014-01-17 21:08:45 +01:00
{
2019-12-06 08:17:10 +01:00
"name" : "ulist_standard_1" ,
2014-01-17 21:08:45 +01:00
"input" : "Some text with a list:\n\n* One item\n* Two items\n* Three items" ,
"expected_output" : "<p>Some text with a list:</p>\n<ul>\n<li>One item</li>\n<li>Two items</li>\n<li>Three items</li>\n</ul>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "Some text with a list:\n\nOne item\nTwo items\nThree items\n"
2014-01-17 21:08:45 +01:00
} ,
2019-12-06 08:17:10 +01:00
{
"name" : "ulist_standard_2" ,
"input" : "Some text with a list:\n\n- One item\n- Two items\n- Three items" ,
"expected_output" : "<p>Some text with a list:</p>\n<ul>\n<li>One item</li>\n<li>Two items</li>\n<li>Three items</li>\n</ul>" ,
"text_content" : "Some text with a list:\n\nOne item\nTwo items\nThree items\n"
} ,
{
"name" : "ulist_standard_3" ,
"input" : "Some text with a list:\n\n+ One item\n+ Two items\n+ Three items" ,
"expected_output" : "<p>Some text with a list:</p>\n<ul>\n<li>One item</li>\n<li>Two items</li>\n<li>Three items</li>\n</ul>" ,
"text_content" : "Some text with a list:\n\nOne item\nTwo items\nThree items\n"
} ,
2020-05-01 01:37:05 +02:00
{
"name" : "list_complexly_nested" ,
"input" : "This is a heavily nested OL\n1. level-1\n 2. level-2\n 3. level-3\n 3. level-3a\n 2. level-2a\n2. level-1a\n" ,
"expected_output" : "<p>This is a heavily nested OL</p>\n<ol>\n<li>level-1<ol start=\"2\">\n<li>level-2<ol start=\"3\">\n<li>level-3</li>\n<li>level-3a</li>\n</ol>\n</li>\n<li>level-2a</li>\n</ol>\n</li>\n<li>level-1a</li>\n</ol>"
} ,
{
"name" : "list_codeblock_interference" ,
"input" : "para:\n\n 1. list-1\n 2. list-2\n 1. list-2a\n 3. list-3\n" ,
"expected_output" : "<p>para:</p>\n<div class=\"codehilite\"><pre><span></span><code>1. list-1\n2. list-2\n 1. list-2a\n3. list-3\n</code></pre></div>"
} ,
2019-12-06 08:17:10 +01:00
{
"name" : "ulist_mixed_bullets" ,
"input" : "Combine four lists:\n\n* One\n- Two\n+ Three\n- Four\n- Five" ,
"expected_output" : "<p>Combine four lists:</p>\n<ul>\n<li>One</li>\n<li>Two</li>\n<li>Three</li>\n<li>Four</li>\n<li>Five</li>\n</ul>" ,
"marked_expected_output" : "<p>Combine four lists:</p>\n<ul>\n<li>One</li>\n</ul>\n<ul>\n<li>Two</li>\n</ul>\n<ul>\n<li>Three</li>\n</ul>\n<ul>\n<li>Four</li>\n<li>Five</li>\n</ul>" ,
"text_content" : "Combine four lists:\n\nOne\nTwo\nThree\nFour\nFive\n"
} ,
2014-01-17 21:08:45 +01:00
{
"name" : "ulist_hanging" ,
"input" : "Some text with a hanging list:\n* One item\n* Two items\n* Three items" ,
"expected_output" : "<p>Some text with a hanging list:</p>\n<ul>\n<li>One item</li>\n<li>Two items</li>\n<li>Three items</li>\n</ul>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "Some text with a hanging list:\n\nOne item\nTwo items\nThree items\n"
2014-01-17 21:08:45 +01:00
} ,
2020-03-02 22:44:03 +01:00
{
"name" : "ulist_codeblock_interference" ,
"input" : "* One \n * Two\n\n Two continued\n This shouldn't be a code block\n" ,
"expected_output" : "<ul>\n<li>One <ul>\n<li>\n<p>Two</p>\n<p>Two continued<br>\nThis shouldn't be a code block</p>\n</li>\n</ul>\n</li>\n</ul>" ,
"marked_expected_output" : "<ul>\n<li><p>One </p>\n<ul>\n<li><p>Two</p>\n<p>Two continued<br>\nThis shouldn't be a code block</p>\n</li>\n</ul>\n</li>\n</ul>" ,
"text_content" : "\nOne \n\nTwo\nTwo continued\nThis shouldn't be a code block\n\n\n\n"
} ,
2014-01-17 21:08:45 +01:00
{
"name" : "ulist_hanging_mixed" ,
"input" : "Plain list\n\n* Alpha\n\n* Beta\n\nThen hang it off:\n* Ypsilon\n* Zeta" ,
"expected_output" : "<p>Plain list</p>\n<ul>\n<li>\n<p>Alpha</p>\n</li>\n<li>\n<p>Beta</p>\n</li>\n</ul>\n<p>Then hang it off:</p>\n<ul>\n<li>Ypsilon</li>\n<li>Zeta</li>\n</ul>" ,
2017-11-02 16:30:36 +01:00
"marked_expected_output" : "<p>Plain list</p>\n<ul>\n<li><p>Alpha</p>\n</li>\n<li><p>Beta</p>\n</li>\n</ul>\n<p>Then hang it off:</p>\n<ul>\n<li>Ypsilon</li>\n<li>Zeta</li>\n</ul>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "Plain list\n\n\nAlpha\n\n\nBeta\n\n\nThen hang it off:\n\nYpsilon\nZeta\n"
2014-01-17 21:08:45 +01:00
} ,
{
"name" : "ulist_hanging_multi" ,
2021-05-10 07:02:14 +02:00
"input" : "Plain list\n* Alpha\n* Beta\n\nAnd again:\n* A\n* B\n* C\n\nOnce more for feeling:\n* Q\n* E\n* D" ,
"expected_output" : "<p>Plain list</p>\n<ul>\n<li>Alpha</li>\n<li>Beta</li>\n</ul>\n<p>And again:</p>\n<ul>\n<li>A</li>\n<li>B</li>\n<li>C</li>\n</ul>\n<p>Once more for feeling:</p>\n<ul>\n<li>Q</li>\n<li>E</li>\n<li>D</li>\n</ul>" ,
"text_content" : "Plain list\n\nAlpha\nBeta\n\nAnd again:\n\nA\nB\nC\n\nOnce more for feeling:\n\nQ\nE\nD\n"
2014-01-17 21:08:45 +01:00
} ,
2019-03-31 18:40:47 +02:00
{
"name" : "ulist_hanging_quoted" ,
"input" : "```quote\nSome text with a hanging list inside quote:\n* one\n* two\n* three\n```" ,
"expected_output" : "<blockquote>\n<p>Some text with a hanging list inside quote:</p>\n<ul>\n<li>one</li>\n<li>two</li>\n<li>three</li>\n</ul>\n</blockquote>" ,
"text_content" : "> Some text with a hanging list inside quote:\n> one\n> two\n> three\n"
} ,
2017-03-26 21:14:05 +02:00
{
"name" : "ulist_nested_ulist_two_space_indent" ,
"input" : "Nested list\n* I am outer list\n * I am inner nested list first item\n * I am inner nested list second item" ,
"expected_output" : "<p>Nested list</p>\n<ul>\n<li>I am outer list<ul>\n<li>I am inner nested list first item</li>\n<li>I am inner nested list second item</li>\n</ul>\n</li>\n</ul>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "Nested list\n\nI am outer list\nI am inner nested list first item\nI am inner nested list second item\n\n\n"
2017-03-26 21:14:05 +02:00
} ,
{
"name" : "ulist_list_two_space_indent" ,
"input" : "* I am outer list\n I am something inside" ,
"expected_output" : "<ul>\n<li>I am outer list<br>\n I am something inside</li>\n</ul>" ,
2017-10-06 23:16:29 +02:00
"marked_expected_output" : "<ul>\n<li>I am outer list<br>\nI am something inside</li>\n</ul>" ,
"text_content" : "\nI am outer list\n I am something inside\n"
2017-03-26 21:14:05 +02:00
} ,
2014-01-17 21:08:45 +01:00
{
"name" : "ulist_codeblock" ,
"input" : "~~~\nint x = 3\n* 4;\n~~~" ,
2020-04-18 03:17:21 +02:00
"expected_output" : "<div class=\"codehilite\"><pre><span></span><code>int x = 3\n* 4;\n</code></pre></div>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "int x = 3\n* 4;\n"
2014-01-17 21:08:45 +01:00
} ,
{
"name" : "malformed_fence" ,
"input" : "~~~~~~~~xxxxxxxxx: xxxxxxxxxxxx xxxxx x xxxxxxxx~~~~~~" ,
"expected_output" : "<p>~~~~~~~~xxxxxxxxx: xxxxxxxxxxxx xxxxx x xxxxxxxx~~~~~~</p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "~~~~~~~~xxxxxxxxx: xxxxxxxxxxxx xxxxx x xxxxxxxx~~~~~~"
2014-01-17 21:08:45 +01:00
} ,
2016-11-08 07:26:38 +01:00
{
"name" : "strikthrough_basic" ,
"input" : "I like ~~software~~ hardware" ,
"expected_output" : "<p>I like <del>software</del> hardware</p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "I like software hardware"
2016-11-08 07:26:38 +01:00
} ,
{
2021-04-22 23:15:05 +02:00
"name" : "strikthrough_multiword_with_no_space_in_between" ,
2016-11-08 07:26:38 +01:00
"input" : "I ~~like software~~ love hardware" ,
"expected_output" : "<p>I <del>like software</del> love hardware</p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "I like software love hardware"
2016-11-08 07:26:38 +01:00
} ,
{
2021-04-22 23:15:05 +02:00
"name" : "strikthrough_multiword_with_space_in_between" ,
2016-11-08 07:26:38 +01:00
"input" : "I ~~ like software ~~ love hardware" ,
"expected_output" : "<p>I <del> like software </del> love hardware</p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "I like software love hardware"
2016-11-08 07:26:38 +01:00
} ,
2017-12-22 12:51:08 +01:00
{
"name" : "strikthrough_link" ,
"input" : "~~test http://xx.xx link~~" ,
2020-05-09 03:44:56 +02:00
"expected_output" : "<p><del>test <a href=\"http://xx.xx\">http://xx.xx</a> link</del></p>" ,
2017-12-22 12:51:08 +01:00
"text_content" : "test http://xx.xx link"
} ,
2014-01-17 21:08:45 +01:00
{
"name" : "underscore_disabled" ,
"input" : "_foo_" ,
2017-11-07 21:01:57 +01:00
"expected_output" : "<p>_foo_</p>"
2014-01-17 21:08:45 +01:00
} ,
{
2016-11-03 07:56:28 +01:00
"name" : "emphasis_text" ,
2014-01-17 21:08:45 +01:00
"input" : "*foo*" ,
2016-11-03 07:56:28 +01:00
"expected_output" : "<p><em>foo</em></p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "foo"
2016-11-03 07:56:28 +01:00
} ,
{
"name" : "emphasis_code" ,
"input" : "const char *x = (char *)y" ,
2017-11-07 21:01:57 +01:00
"expected_output" : "<p>const char *x = (char *)y</p>"
2016-11-03 07:56:28 +01:00
} ,
{
"name" : "emphasis_with_space" ,
"input" : "A *foo bar* is a *baz quux*" ,
"expected_output" : "<p>A <em>foo bar</em> is a <em>baz quux</em></p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "A foo bar is a baz quux"
2014-01-17 21:08:45 +01:00
} ,
2018-03-29 00:25:58 +02:00
{
"name" : "emphasis_with_html" ,
2021-05-10 07:02:14 +02:00
"input" : "*<h1>Hello world</h1>*" ,
"expected_output" : "<p><em><h1>Hello world</h1></em></p>"
2018-03-29 00:25:58 +02:00
} ,
2014-01-17 21:08:45 +01:00
{
"name" : "underscore_strong_disabled" ,
"input" : "__foo__" ,
2017-11-07 21:01:57 +01:00
"expected_output" : "<p>__foo__</p>"
2014-01-17 21:08:45 +01:00
} ,
{
"name" : "star_strong" ,
"input" : "**foo**" ,
"expected_output" : "<p><strong>foo</strong></p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "foo"
2014-01-17 21:08:45 +01:00
} ,
2019-05-01 20:45:41 +02:00
{
"name" : "star_emoji" ,
"input" : "**:smile:**" ,
2020-06-30 21:16:29 +02:00
"expected_output" : "<p><strong><span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span></strong></p>" ,
"text_content" : "\ud83d\ude42"
2019-05-01 20:45:41 +02:00
} ,
2018-02-17 01:59:22 +01:00
{
"name" : "star_strong_em" ,
"input" : "***foo***" ,
"expected_output" : "<p><strong><em>foo</em></strong></p>" ,
"text_content" : "foo"
} ,
2018-03-29 00:25:58 +02:00
{
"name" : "strong_with_html" ,
2021-05-10 07:02:14 +02:00
"input" : "**<h1>Hello world</h1>**" ,
"expected_output" : "<p><strong><h1>Hello world</h1></strong></p>"
2018-03-29 00:25:58 +02:00
} ,
2017-07-28 06:28:45 +02:00
{
"name" : "numbered_list" ,
2019-08-11 07:41:34 +02:00
"input" : "1. A\n2. B\n 3. C" ,
"expected_output" : "<ol>\n<li>A</li>\n<li>B<ol start=\"3\">\n<li>C</li>\n</ol>\n</li>\n</ol>" ,
"text_content" : "1. A\n2. B\n 3. C"
2017-07-28 06:28:45 +02:00
} ,
2017-12-03 15:24:21 +01:00
{
2019-08-11 07:41:34 +02:00
"name" : "auto_renumbered_list_trick" ,
"input" : "1. A\n1. B\n 1. C\n1. D" ,
"expected_output" : "<ol>\n<li>A</li>\n<li>B<ol>\n<li>C</li>\n</ol>\n</li>\n<li>D</li>\n</ol>" ,
"text_content" : "1. A\n2. B\n 1. C\n3. D"
2017-12-03 15:24:21 +01:00
} ,
{
"name" : "auto_renumbered_list_from" ,
"input" : "3. A\n3. B\n3. C\n3. D" ,
2019-08-11 07:41:34 +02:00
"expected_output" : "<ol start=\"3\">\n<li>A</li>\n<li>B</li>\n<li>C</li>\n<li>D</li>\n</ol>" ,
2017-12-03 15:24:21 +01:00
"text_content" : "3. A\n4. B\n5. C\n6. D"
} ,
{
2019-08-11 07:41:34 +02:00
"name" : "two_auto_renumbered_lists" ,
"input" : "1. A\n3. B\n 2. C\n1. D" ,
"expected_output" : "<ol>\n<li>A</li>\n<li>B<ol start=\"2\">\n<li>C</li>\n</ol>\n</li>\n<li>D</li>\n</ol>" ,
"text_content" : "1. A\n2. B\n 2. C\n3. D"
2017-12-03 15:24:21 +01:00
} ,
2014-01-17 21:08:45 +01:00
{
"name" : "linkify_interference" ,
2020-05-09 03:44:56 +02:00
"input" : "link: xx, x xxxxx xx xxxx xx\n\n[xxxxx #xx](http://xxxxxxxxx:xxxx/xxx/xxxxxx%78xxxx/xx/):**xxxxxxx**\n\nxxxxxxx xxxxx xxxx xxxxx:\n`xxxxxx`: xxxxxxx\n`xxxxxx`: xxxxx\n`xxxxxx`: xxxxx xxxxx" ,
"expected_output" : "<p>link: xx, x xxxxx xx xxxx xx</p>\n<p><a href=\"http://xxxxxxxxx:xxxx/xxx/xxxxxx%78xxxx/xx/\">xxxxx #xx</a>:<strong>xxxxxxx</strong></p>\n<p>xxxxxxx xxxxx xxxx xxxxx:<br>\n<code>xxxxxx</code>: xxxxxxx<br>\n<code>xxxxxx</code>: xxxxx<br>\n<code>xxxxxx</code>: xxxxx xxxxx</p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "link: xx, x xxxxx xx xxxx xx\nxxxxx #xx:xxxxxxx\nxxxxxxx xxxxx xxxx xxxxx:\nxxxxxx: xxxxxxx\nxxxxxx: xxxxx\nxxxxxx: xxxxx xxxxx"
2014-01-17 21:08:45 +01:00
} ,
{
"name" : "inline_image" ,
"input" : "Google logo today: https://www.google.com/images/srpr/logo4w.png\nKinda boring" ,
2020-05-09 03:44:56 +02:00
"expected_output" : "<p>Google logo today: <a href=\"https://www.google.com/images/srpr/logo4w.png\">https://www.google.com/images/srpr/logo4w.png</a><br>\nKinda boring</p>\n<div class=\"message_inline_image\"><a href=\"https://www.google.com/images/srpr/logo4w.png\"><img data-src-fullsize=\"/thumbnail?url=https%3A%2F%2Fwww.google.com%2Fimages%2Fsrpr%2Flogo4w.png&size=full\" src=\"/thumbnail?url=https%3A%2F%2Fwww.google.com%2Fimages%2Fsrpr%2Flogo4w.png&size=thumbnail\"></a></div>" ,
2017-10-06 23:16:29 +02:00
"backend_only_rendering" : true ,
"text_content" : "Google logo today: https:\/\/www.google.com\/images\/srpr\/logo4w.png\nKinda boring\n"
2014-01-17 21:08:45 +01:00
} ,
2017-12-25 21:35:23 +01:00
{
"name" : "blockquote_inline_image" ,
"input" : ">Google logo today:\n>https://www.google.com/images/srpr/logo4w.png\n>Kinda boring" ,
2020-05-09 03:44:56 +02:00
"expected_output" : "<blockquote>\n<p>Google logo today:<br>\n<a href=\"https://www.google.com/images/srpr/logo4w.png\">https://www.google.com/images/srpr/logo4w.png</a><br>\nKinda boring</p>\n</blockquote>" ,
2017-12-25 21:35:23 +01:00
"backend_only_rendering" : true ,
2018-05-02 07:01:29 +02:00
"text_content" : "> Google logo today:\n> https:\/\/www.google.com\/images\/srpr\/logo4w.png\n> Kinda boring\n"
2017-12-25 21:35:23 +01:00
} ,
2014-01-17 21:08:45 +01:00
{
"name" : "two_inline_images" ,
2022-10-27 18:48:04 +02:00
"input" : "Google logo today: https://www.google.com/images/srpr/logo4w.png\nKinda boring\nZulip logo: https://zulip.com/static/images/logo/zulip-icon-128x128.png" ,
"expected_output" : "<p>Google logo today: <a href=\"https:\/\/www.google.com\/images\/srpr\/logo4w.png\">https:\/\/www.google.com\/images\/srpr\/logo4w.png<\/a><br>\nKinda boring<br>\nZulip logo: <a href=\"https:\/\/zulip.com\/static\/images\/logo\/zulip-icon-128x128.png\">https:\/\/zulip.com\/static\/images\/logo\/zulip-icon-128x128.png<\/a><\/p>\n<div class=\"message_inline_image\"><a href=\"https:\/\/www.google.com\/images\/srpr\/logo4w.png\"><img data-src-fullsize=\"\/thumbnail?url=https%3A%2F%2Fwww.google.com%2Fimages%2Fsrpr%2Flogo4w.png&size=full\" src=\"\/thumbnail?url=https%3A%2F%2Fwww.google.com%2Fimages%2Fsrpr%2Flogo4w.png&size=thumbnail\"><\/a><\/div><div class=\"message_inline_image\"><a href=\"https:\/\/zulip.com\/static\/images\/logo\/zulip-icon-128x128.png\"><img data-src-fullsize=\"\/thumbnail?url=https%3A%2F%2Fzulip.com%2Fstatic%2Fimages%2Flogo%2Fzulip-icon-128x128.png&size=full\" src=\"\/thumbnail?url=https%3A%2F%2Fzulip.com%2Fstatic%2Fimages%2Flogo%2Fzulip-icon-128x128.png&size=thumbnail\"><\/a><\/div>" ,
2018-02-16 21:06:05 +01:00
"backend_only_rendering" : true ,
2022-10-27 18:48:04 +02:00
"text_content" : "Google logo today: https:\/\/www.google.com\/images\/srpr\/logo4w.png\nKinda boring\nZulip logo: https:\/\/zulip.com\/static\/images\/logo\/zulip-icon-128x128.png\n"
2018-02-16 21:06:05 +01:00
} ,
{
"name" : "deduplicate_inline_previews" ,
2014-01-17 21:08:45 +01:00
"input" : "Google logo today: https://www.google.com/images/srpr/logo4w.png\nKinda boringGoogle logo today: https://www.google.com/images/srpr/logo4w.png\nKinda boring" ,
2020-05-09 03:44:56 +02:00
"expected_output" : "<p>Google logo today: <a href=\"https://www.google.com/images/srpr/logo4w.png\">https://www.google.com/images/srpr/logo4w.png</a><br>\nKinda boringGoogle logo today: <a href=\"https://www.google.com/images/srpr/logo4w.png\">https://www.google.com/images/srpr/logo4w.png</a><br>\nKinda boring</p>\n<div class=\"message_inline_image\"><a href=\"https://www.google.com/images/srpr/logo4w.png\"><img data-src-fullsize=\"/thumbnail?url=https%3A%2F%2Fwww.google.com%2Fimages%2Fsrpr%2Flogo4w.png&size=full\" src=\"/thumbnail?url=https%3A%2F%2Fwww.google.com%2Fimages%2Fsrpr%2Flogo4w.png&size=thumbnail\"></a></div>" ,
2017-10-06 23:16:29 +02:00
"backend_only_rendering" : true ,
"text_content" : "Google logo today: https:\/\/www.google.com\/images\/srpr\/logo4w.png\nKinda boringGoogle logo today: https:\/\/www.google.com\/images\/srpr\/logo4w.png\nKinda boring\n"
2014-01-17 21:08:45 +01:00
} ,
2017-12-25 21:35:23 +01:00
{
"name" : "bulleted_list_inlining" ,
"input" : "* Google?\n* Google. https://www.google.com/images/srpr/logo4w.png\n* Google!" ,
2020-05-09 03:44:56 +02:00
"expected_output" : "<ul>\n<li>Google?</li>\n<li>Google. <a href=\"https://www.google.com/images/srpr/logo4w.png\">https://www.google.com/images/srpr/logo4w.png</a><div class=\"message_inline_image\"><a href=\"https://www.google.com/images/srpr/logo4w.png\"><img data-src-fullsize=\"/thumbnail?url=https%3A%2F%2Fwww.google.com%2Fimages%2Fsrpr%2Flogo4w.png&size=full\" src=\"/thumbnail?url=https%3A%2F%2Fwww.google.com%2Fimages%2Fsrpr%2Flogo4w.png&size=thumbnail\"></a></div></li>\n<li>Google!</li>\n</ul>" ,
2017-12-25 21:35:23 +01:00
"backend_only_rendering" : true ,
"text_content" : "\nGoogle?\nGoogle. https://www.google.com/images/srpr/logo4w.png\nGoogle!\n"
} ,
2017-11-27 10:03:18 +01:00
{
"name" : "only_inline_image" ,
"input" : "https://www.google.com/images/srpr/logo4w.png" ,
2020-05-09 03:44:56 +02:00
"expected_output" : "<div class=\"message_inline_image\"><a href=\"https://www.google.com/images/srpr/logo4w.png\"><img data-src-fullsize=\"/thumbnail?url=https%3A%2F%2Fwww.google.com%2Fimages%2Fsrpr%2Flogo4w.png&size=full\" src=\"/thumbnail?url=https%3A%2F%2Fwww.google.com%2Fimages%2Fsrpr%2Flogo4w.png&size=thumbnail\"></a></div>" ,
2017-11-27 10:03:18 +01:00
"backend_only_rendering" : true
} ,
2017-12-25 21:35:23 +01:00
{
"name" : "only_named_inline_image" ,
2020-10-23 02:43:28 +02:00
"input" : "[Google link](https://www.google.com/images/srpr/logo4w.png)" ,
"expected_output" : "<p><a href=\"https://www.google.com/images/srpr/logo4w.png\">Google link</a></p>\n<div class=\"message_inline_image\"><a href=\"https://www.google.com/images/srpr/logo4w.png\" title=\"Google link\"><img data-src-fullsize=\"/thumbnail?url=https%3A%2F%2Fwww.google.com%2Fimages%2Fsrpr%2Flogo4w.png&size=full\" src=\"/thumbnail?url=https%3A%2F%2Fwww.google.com%2Fimages%2Fsrpr%2Flogo4w.png&size=thumbnail\"></a></div>" ,
2017-12-25 21:35:23 +01:00
"backend_only_rendering" : true ,
2020-10-23 02:43:28 +02:00
"text_content" : "Google link\n"
2017-12-25 21:35:23 +01:00
} ,
2017-11-27 10:03:18 +01:00
{
"name" : "only_non_image_link" ,
"input" : "https://github.com" ,
2020-05-09 03:44:56 +02:00
"expected_output" : "<p><a href=\"https://github.com\">https://github.com</a></p>"
2017-11-27 10:03:18 +01:00
} ,
2022-08-09 11:30:16 +02:00
{
"name" : "only_inline_video" ,
"input" : "https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4" ,
"expected_output" : "<div class=\"message_inline_image message_inline_video\"><a href=\"https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4\"><video data-video-original-url=\"https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4\" preload=\"metadata\" src=\"https://external-content.zulipcdn.net/external_content/785b3eb6f6165491371895ba42ead0e3661ae44b/68747470733a2f2f66696c652d6578616d706c65732d636f6d2e6769746875622e696f2f75706c6f6164732f323031372f30342f66696c655f6578616d706c655f4d50345f3438305f315f354d472e6d7034\"></video></a></div>" ,
"backend_only_rendering" : true
} ,
{
"name" : "only_named_inline_video" ,
"input" : "[Google link](https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4)" ,
"expected_output" : "<p><a href=\"https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4\">Google link</a></p>\n<div class=\"message_inline_image message_inline_video\"><a href=\"https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4\" title=\"Google link\"><video data-video-original-url=\"https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4\" preload=\"metadata\" src=\"https://external-content.zulipcdn.net/external_content/785b3eb6f6165491371895ba42ead0e3661ae44b/68747470733a2f2f66696c652d6578616d706c65732d636f6d2e6769746875622e696f2f75706c6f6164732f323031372f30342f66696c655f6578616d706c655f4d50345f3438305f315f354d472e6d7034\"></video></a></div>" ,
"backend_only_rendering" : true ,
"text_content" : "Google link\n"
} ,
2019-08-11 13:34:24 +02:00
{
"name" : "link_with_text" ,
"input" : "[hello](https://github.com)" ,
2020-05-09 03:44:56 +02:00
"expected_output" : "<p><a href=\"https://github.com\">hello</a></p>"
2019-08-11 13:34:24 +02:00
} ,
{
"name" : "link_without_text" ,
"input" : "[](https://github.com)" ,
2020-05-09 03:44:56 +02:00
"expected_output" : "<p><a href=\"https://github.com\">https://github.com</a></p>"
2019-08-11 13:34:24 +02:00
} ,
{
"name" : "link_with_empty_text" ,
"input" : "[ ](https://github.com)" ,
2020-05-09 03:44:56 +02:00
"expected_output" : "<p><a href=\"https://github.com\">https://github.com</a></p>"
2019-08-11 13:34:24 +02:00
} ,
2020-03-24 03:48:32 +01:00
{
"name" : "fragment_link" ,
"input" : "[foo](http://zulip.testserver/#narrow/stream/1-Denmark)" ,
2020-05-09 03:44:56 +02:00
"expected_output" : "<p><a href=\"#narrow/stream/1-Denmark\">foo</a></p>" ,
"marked_expected_output" : "<p><a href=\"http://zulip.testserver/#narrow/stream/1-Denmark\">foo</a></p>"
2020-03-24 03:48:32 +01:00
} ,
{
"name" : "not_fragment_link" ,
"input" : "[foo](http://zulip.testserver/https://example.com)" ,
2020-05-09 03:44:56 +02:00
"expected_output" : "<p><a href=\"http://zulip.testserver/https://example.com\">foo</a></p>"
2020-03-24 03:48:32 +01:00
} ,
2014-01-17 21:08:45 +01:00
{
"name" : "nl2br" ,
"input" : "test\nbar" ,
"expected_output" : "<p>test<br>\nbar</p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "test\nbar"
2014-01-17 21:08:45 +01:00
} ,
{
"name" : "nl2br_trailing_space" ,
"input" : "test " ,
"expected_output" : "<p>test </p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "test "
2014-01-17 21:08:45 +01:00
} ,
{
"name" : "tables" ,
2021-05-10 07:02:14 +02:00
"input" : "This is a table:\n\nFirst header | Second header\n------------- | -------------\nContent cell | Content cell\nContent cell | Content cell\n" ,
"expected_output" : "<p>This is a table:</p>\n<table>\n<thead>\n<tr>\n<th>First header</th>\n<th>Second header</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Content cell</td>\n<td>Content cell</td>\n</tr>\n<tr>\n<td>Content cell</td>\n<td>Content cell</td>\n</tr>\n</tbody>\n</table>" ,
"text_content" : "This is a table:\n\n\n\nFirst header\nSecond header\n\n\n\n\nContent cell\nContent cell\n\n\nContent cell\nContent cell\n\n\n"
2014-01-17 21:08:45 +01:00
} ,
{
"name" : "multiline_strong" ,
"input" : "You can check out **any time you'd like\nBut you can never leave**" ,
"expected_output" : "<p>You can check out **any time you'd like<br>\nBut you can never leave**</p>" ,
2020-12-19 20:04:57 +01:00
"marked_expected_output" : "<p>You can check out <strong>any time you'd like<br>\nBut you can never leave</strong></p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "You can check out **any time you'd like\nBut you can never leave**"
2014-01-24 22:52:37 +01:00
} ,
{
"name" : "many_emoji" ,
2017-11-08 19:40:43 +01:00
"input" : "test :smile: again :poop:\n:) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:" ,
2020-06-30 21:16:29 +02:00
"expected_output" : "<p>test <span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span> again <span aria-label=\"poop\" class=\"emoji emoji-1f4a9\" role=\"img\" title=\"poop\">:poop:</span><br>\n:) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:</p>" ,
"text_content" : "test \ud83d\ude42 again \ud83d\udca9\n:) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:"
2018-01-15 19:36:32 +01:00
} ,
2018-03-25 23:23:22 +02:00
{
"name" : "translate_emoticons_not_enabled" ,
"input" : ":)" ,
"expected_output" : "<p>:)</p>" ,
"text_content" : ":)" ,
"translate_emoticons" : false
} ,
{
"name" : "translate_emoticons_enabled" ,
"input" : ":)" ,
2020-06-30 21:16:29 +02:00
"expected_output" : "<p><span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span></p>" ,
2018-07-26 19:35:28 +02:00
"text_content" : "\ud83d\ude42" ,
2018-03-25 23:23:22 +02:00
"translate_emoticons" : true
} ,
2018-01-15 19:36:32 +01:00
{
"name" : "translate_emoticons" ,
2020-06-30 21:16:29 +02:00
"input" : ":) foo :( bar <3 with space : ) real emoji :smile:" ,
"expected_output" : "<p><span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span> foo <span aria-label=\"frown\" class=\"emoji emoji-1f641\" role=\"img\" title=\"frown\">:frown:</span> bar <span aria-label=\"heart\" class=\"emoji emoji-2764\" role=\"img\" title=\"heart\">:heart:</span> with space : ) real emoji <span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span></p>" ,
2018-07-26 19:35:28 +02:00
"text_content" : "\ud83d\ude42 foo \ud83d\ude41 bar \u2764 with space : ) real emoji \ud83d\ude42" ,
2018-03-25 23:23:22 +02:00
"translate_emoticons" : true
2018-01-15 19:36:32 +01:00
} ,
{
2023-01-02 20:50:23 +01:00
"name" : "translate_emoticons_whitespace" ,
2018-01-15 19:36:32 +01:00
"input" : "a:) ;)b" ,
"expected_output" : "<p>a:) ;)b</p>" ,
2018-03-25 23:23:22 +02:00
"text_content" : "a:) ;)b" ,
"translate_emoticons" : true
2018-01-15 19:36:32 +01:00
} ,
2018-06-20 17:09:18 +02:00
{
"name" : "translate_emoticons_newline" ,
"input" : ":) test\n:) test" ,
2020-06-30 21:16:29 +02:00
"expected_output" : "<p><span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span> test<br>\n<span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span> test</p>" ,
2018-07-26 19:35:28 +02:00
"text_content" : "\ud83d\ude42 test\n\ud83d\ude42 test" ,
2018-06-20 17:09:18 +02:00
"translate_emoticons" : true
} ,
2018-01-15 19:36:32 +01:00
{
"name" : "translate_emoticons_in_code" ,
"input" : "`:)`" ,
"expected_output" : "<p><code>:)</code></p>" ,
2018-03-25 23:23:22 +02:00
"text_content" : ":)" ,
"translate_emoticons" : true
2014-01-24 22:52:37 +01:00
} ,
2018-03-30 00:34:25 +02:00
{
"name" : "translate_emoticons_at_sentence_end" ,
"input" : "Translate this :)." ,
2020-06-30 21:16:29 +02:00
"expected_output" : "<p>Translate this <span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span>.</p>" ,
2018-07-26 19:35:28 +02:00
"text_content" : "Translate this \ud83d\ude42." ,
2018-03-30 00:34:25 +02:00
"translate_emoticons" : true
} ,
{
"name" : "translate_emoticons_between_symbols" ,
"input" : "Translate this !:)?" ,
2020-06-30 21:16:29 +02:00
"expected_output" : "<p>Translate this !<span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span>?</p>" ,
2018-03-30 00:34:25 +02:00
"marked_expected_output" : "<p>Translate this !:)?</p>" ,
2018-07-26 19:35:28 +02:00
"text_content" : "Translate this !\ud83d\ude42?" ,
2018-03-30 00:34:25 +02:00
"translate_emoticons" : true
} ,
2014-01-24 22:52:37 +01:00
{
"name" : "random_emoji_1" ,
2017-01-26 08:35:23 +01:00
"input" : ":airplane:" ,
2019-01-14 08:45:37 +01:00
"expected_output" : "<p><span aria-label=\"airplane\" class=\"emoji emoji-2708\" role=\"img\" title=\"airplane\">:airplane:</span></p>"
2014-01-24 22:52:37 +01:00
} ,
2017-02-27 03:27:20 +01:00
{
"name" : "zulip_emoji" ,
"input" : ":zulip:" ,
2017-06-09 10:30:24 +02:00
"expected_output" : "<p><img alt=\":zulip:\" class=\"emoji\" src=\"/static/generated/emoji/images/emoji/unicode/zulip.png\" title=\"zulip\"></p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : ":zulip:"
2017-02-27 03:27:20 +01:00
} ,
2014-01-24 22:52:37 +01:00
{
"name" : "random_emoji_2" ,
"input" : ":poop:" ,
2019-01-14 08:45:37 +01:00
"expected_output" : "<p><span aria-label=\"poop\" class=\"emoji emoji-1f4a9\" role=\"img\" title=\"poop\">:poop:</span></p>"
2014-01-24 22:52:37 +01:00
} ,
2023-08-10 21:00:45 +02:00
{
"name" : "emoji_sequence_one" ,
"input" : "🤷♀️" ,
"expected_output" : "<p><span aria-label=\"woman shrugging\" class=\"emoji emoji-1f937-200d-2640\" role=\"img\" title=\"woman shrugging\">:woman_shrugging:</span></p>"
} ,
{
"name" : "emoji_sequence_two" ,
"input" : "👁🗨 #️⃣" ,
"expected_output" : "<p><span aria-label=\"eye in speech bubble\" class=\"emoji emoji-1f441-200d-1f5e8\" role=\"img\" title=\"eye in speech bubble\">:eye_in_speech_bubble:</span> <span aria-label=\"hash\" class=\"emoji emoji-0023-20e3\" role=\"img\" title=\"hash\">:hash:</span></p>"
} ,
{
"name" : "unrecognized_emoji_sequence_one" ,
"input" : "pheonix bird from 15.1: 🐦🔥" ,
"expected_output" : "<p>pheonix bird from 15.1: 🐦🔥</p>"
} ,
{
"name" : "unrecognized_emoji_sequence_two" ,
"input" : "lime from 15.1: 🍋🟩" ,
"expected_output" : "<p>lime from 15.1: 🍋🟩</p>"
} ,
{
"name" : "unrecognized_emoji_sequence_three" ,
"input" : "normal lemon 🍋, purple lemon? 🍋🟪" ,
"expected_output" : "<p>normal lemon <span aria-label=\"lemon\" class=\"emoji emoji-1f34b\" role=\"img\" title=\"lemon\">:lemon:</span>, purple lemon? 🍋🟪</p>"
} ,
{
"name" : "unrecognized_emoji_sequence_four" ,
"input" : "medium-skinned person riding scooter back and forth: 🧑🏽🛴↩️" ,
"expected_output" : "<p>medium-skinned person riding scooter back and forth: 🧑🏽🛴↩️</p>"
} ,
{
"name" : "unrecognized_emoji_sequence_skin_tone" ,
"input" : "man in manual wheelchair: dark skin tone 👨🏿🦽" ,
"expected_output" : "<p>man in manual wheelchair: dark skin tone 👨🏿🦽</p>"
} ,
2016-11-08 12:20:56 +01:00
{
"name" : "emojis_without_space" ,
"input" : ":cat:hello:dog::rabbit:" ,
2019-01-14 08:45:37 +01:00
"expected_output" : "<p><span aria-label=\"cat\" class=\"emoji emoji-1f408\" role=\"img\" title=\"cat\">:cat:</span>hello<span aria-label=\"dog\" class=\"emoji emoji-1f415\" role=\"img\" title=\"dog\">:dog:</span><span aria-label=\"rabbit\" class=\"emoji emoji-1f407\" role=\"img\" title=\"rabbit\">:rabbit:</span></p>" ,
2017-11-08 19:40:43 +01:00
"text_content" : "\ud83d\udc08hello\ud83d\udc15\ud83d\udc07"
2016-11-08 12:20:56 +01:00
} ,
{
"name" : "emojis_newline" ,
"input" : ":cat:\n:dog:" ,
2019-01-14 08:45:37 +01:00
"expected_output" : "<p><span aria-label=\"cat\" class=\"emoji emoji-1f408\" role=\"img\" title=\"cat\">:cat:</span><br>\n<span aria-label=\"dog\" class=\"emoji emoji-1f415\" role=\"img\" title=\"dog\">:dog:</span></p>" ,
2017-11-08 19:40:43 +01:00
"text_content" : "\ud83d\udc08\n\ud83d\udc15"
2016-11-08 12:20:56 +01:00
} ,
2014-01-24 22:52:37 +01:00
{
"name" : "not_emoji" ,
"input" : ":not_an_emoji:" ,
"expected_output" : "<p>:not_an_emoji:</p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : ":not_an_emoji:"
2014-01-24 22:52:37 +01:00
} ,
2016-06-24 22:39:44 +02:00
{
"name" : "unicode_emoji" ,
"input" : "\ud83d\udca9" ,
2019-01-14 08:45:37 +01:00
"expected_output" : "<p><span aria-label=\"poop\" class=\"emoji emoji-1f4a9\" role=\"img\" title=\"poop\">:poop:</span></p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "\ud83d\udca9"
2016-06-24 22:39:44 +02:00
} ,
{
"name" : "two_unicode_emoji" ,
"input" : "\ud83d\udca9\ud83d\udca9" ,
2019-01-14 08:45:37 +01:00
"expected_output" : "<p><span aria-label=\"poop\" class=\"emoji emoji-1f4a9\" role=\"img\" title=\"poop\">:poop:</span><span aria-label=\"poop\" class=\"emoji emoji-1f4a9\" role=\"img\" title=\"poop\">:poop:</span><\/p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "\ud83d\udca9\ud83d\udca9"
2016-06-24 22:39:44 +02:00
} ,
{
"name" : "two_unicode_emoji_separated_by_text" ,
"input" : "\ud83d\udca9 word \ud83d\udca9" ,
2019-01-14 08:45:37 +01:00
"expected_output" : "<p><span aria-label=\"poop\" class=\"emoji emoji-1f4a9\" role=\"img\" title=\"poop\">:poop:</span> word <span aria-label=\"poop\" class=\"emoji emoji-1f4a9\" role=\"img\" title=\"poop\">:poop:</span><\/p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "\ud83d\udca9 word \ud83d\udca9"
2016-06-24 22:39:44 +02:00
} ,
2017-05-15 11:24:01 +02:00
{
"name" : "miscellaneous_symbols_and_pictographs" ,
"input" : "Merry Christmas!!\ud83c\udf84" ,
2019-01-14 08:45:37 +01:00
"expected_output" : "<p>Merry Christmas!!<span aria-label=\"holiday tree\" class=\"emoji emoji-1f384\" role=\"img\" title=\"holiday tree\">:holiday_tree:</span><\/p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "Merry Christmas!!\ud83c\udf84"
2017-05-15 11:24:01 +02:00
} ,
2016-11-12 23:37:47 +01:00
{
"name" : "miscellaneous_and_dingbats_emoji" ,
"input" : "\u2693\u2797" ,
2019-01-14 08:45:37 +01:00
"expected_output" : "<p><span aria-label=\"anchor\" class=\"emoji emoji-2693\" role=\"img\" title=\"anchor\">:anchor:</span><span aria-label=\"division\" class=\"emoji emoji-2797\" role=\"img\" title=\"division\">:division:</span><\/p>"
2016-11-12 23:37:47 +01:00
} ,
2017-05-15 11:24:01 +02:00
{
"name" : "supplemental_symbols_and_pictographs" ,
"input" : "I am a robot \ud83e\udd16." ,
2019-01-14 08:45:37 +01:00
"expected_output" : "<p>I am a robot <span aria-label=\"robot\" class=\"emoji emoji-1f916\" role=\"img\" title=\"robot\">:robot:</span>.<\/p>"
2017-05-15 11:24:01 +02:00
} ,
{
"name" : "miscellaneous_symbols_and_arrows" ,
2023-08-10 21:00:45 +02:00
"input" : "Black upward arrow \u2b06\ufe0f" ,
2019-01-14 08:45:37 +01:00
"expected_output" : "<p>Black upward arrow <span aria-label=\"up\" class=\"emoji emoji-2b06\" role=\"img\" title=\"up\">:up:</span><\/p>"
2017-05-15 11:24:01 +02:00
} ,
2016-11-12 19:10:51 +01:00
{
"name" : "unicode_emoji_without_space" ,
"input" : "Extra\ud83d\udc7dTerrestrial" ,
2019-01-14 08:45:37 +01:00
"expected_output" : "<p>Extra<span aria-label=\"alien\" class=\"emoji emoji-1f47d\" role=\"img\" title=\"alien\">:alien:</span>Terrestrial<\/p>"
2016-11-12 19:10:51 +01:00
} ,
{
"name" : "unicode_emojis_new_line" ,
"input" : "\ud83d\udc7d\n\ud83d\udc7d" ,
2019-01-14 08:45:37 +01:00
"expected_output" : "<p><span aria-label=\"alien\" class=\"emoji emoji-1f47d\" role=\"img\" title=\"alien\">:alien:</span><br>\n<span aria-label=\"alien\" class=\"emoji emoji-1f47d\" role=\"img\" title=\"alien\">:alien:</span></p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "\ud83d\udc7d\n\ud83d\udc7d"
2016-11-12 19:10:51 +01:00
} ,
2014-01-24 22:52:37 +01:00
{
"name" : "emoji_alongside_punctuation" ,
"input" : ":smile:, :smile:; :smile:" ,
2020-06-30 21:16:29 +02:00
"expected_output" : "<p><span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span>, <span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span>; <span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span></p>"
2014-02-03 17:13:40 +01:00
} ,
2017-10-01 16:13:05 +02:00
{
"name" : "new_emoji_test" ,
2017-11-08 19:40:43 +01:00
"input" : ":avocado:, :kiwi:, :selfie:, :gear:, :comet:, :gold:" ,
2019-01-14 08:45:37 +01:00
"expected_output" : "<p><span aria-label=\"avocado\" class=\"emoji emoji-1f951\" role=\"img\" title=\"avocado\">:avocado:</span>, <span aria-label=\"kiwi\" class=\"emoji emoji-1f95d\" role=\"img\" title=\"kiwi\">:kiwi:</span>, <span aria-label=\"selfie\" class=\"emoji emoji-1f933\" role=\"img\" title=\"selfie\">:selfie:</span>, <span aria-label=\"gear\" class=\"emoji emoji-2699\" role=\"img\" title=\"gear\">:gear:</span>, <span aria-label=\"comet\" class=\"emoji emoji-2604\" role=\"img\" title=\"comet\">:comet:</span>, <span aria-label=\"gold\" class=\"emoji emoji-1f947\" role=\"img\" title=\"gold\">:gold:</span></p>"
2017-10-01 16:13:05 +02:00
} ,
2018-06-21 19:40:43 +02:00
{
"name" : "emoji_pipeline_newline" ,
"input" : "The winner is:\nsmiley:smiley:" ,
2019-01-14 08:45:37 +01:00
"expected_output" : "<p>The winner is:<br>\nsmiley<span aria-label=\"smiley\" class=\"emoji emoji-1f603\" role=\"img\" title=\"smiley\">:smiley:</span></p>"
2018-06-21 19:40:43 +02:00
} ,
{
"name" : "emoji_pipeline_emphasis" ,
"input" : "Testing *:smiley*: :sm*iley*: Testing" ,
"expected_output" : "<p>Testing <em>:smiley</em>: :sm<em>iley</em>: Testing</p>"
} ,
{
"name" : "emoji_pipeline_link" ,
"input" : "Visit https:smiley://google.com." ,
2019-01-14 08:45:37 +01:00
"expected_output" : "<p>Visit https<span aria-label=\"smiley\" class=\"emoji emoji-1f603\" role=\"img\" title=\"smiley\">:smiley:</span>//google.com.</p>"
2018-06-21 19:40:43 +02:00
} ,
2017-10-01 16:13:05 +02:00
{
"name" : "skin_tones_are_banned" ,
"input" : ":skin-tone-2: :skin-tone-3:" ,
2017-11-07 21:01:57 +01:00
"expected_output" : "<p>:skin-tone-2: :skin-tone-3:</p>"
2017-10-01 16:13:05 +02:00
} ,
{
2022-02-08 00:13:33 +01:00
"name" : "fried_egg_emoji_nonexistent" ,
2017-10-01 16:13:05 +02:00
"input" : "new :fried_egg: emoji is banned for now." ,
2017-11-07 21:01:57 +01:00
"expected_output" : "<p>new :fried_egg: emoji is banned for now.</p>"
2017-10-01 16:13:05 +02:00
} ,
{
"name" : "emojis_with_zwj_are_banned" ,
"input" : "Emojis like :man-girl-girl: which have ZWJ are banned for now." ,
"expected_output" : "<p>Emojis like :man-girl-girl: which have ZWJ are banned for now.</p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "Emojis like :man-girl-girl: which have ZWJ are banned for now."
2017-10-01 16:13:05 +02:00
} ,
2019-03-05 08:18:59 +01:00
{
"name" : "valid_emoji_preceded_by_invalid_emoji" ,
"input" : "This is :invalidemoji: which should not prevent rendering :smile:" ,
2020-06-30 21:16:29 +02:00
"expected_output" : "<p>This is :invalidemoji: which should not prevent rendering <span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span></p>"
2019-03-05 08:18:59 +01:00
} ,
2014-02-03 17:13:40 +01:00
{
"name" : "safe_html" ,
"input" : "<h1>stay normal</h1> thanks" ,
"expected_output" : "<p><h1>stay normal</h1> thanks</p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "<h1>stay normal<\/h1> thanks"
2014-02-03 17:13:40 +01:00
} ,
2016-10-17 22:47:52 +02:00
{
"name" : "safe_html_with_simple_script_tag" ,
"input" : "<script>alert(1)</script>" ,
"expected_output" : "<p><script>alert(1)</script></p>" ,
2017-11-02 16:30:36 +01:00
"marked_expected_output" : "<p><script>alert(1)</script>\n\n</p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "<script>alert(1)<\/script>"
2016-10-17 22:47:52 +02:00
} ,
{
"name" : "safe_html_nested_script_tag" ,
"input" : "<<script>script>evil()<</script>/script>" ,
"expected_output" : "<p><<script>script>evil()<</script>/script></p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "<<script>script>evil()<<\/script>\/script>"
2016-10-17 22:47:52 +02:00
} ,
{
"name" : "safe_html_nested_script_tag_with_parse_error" ,
"input" : "<<x>script>evil()<</x>/script>" ,
"expected_output" : "<p><<x>script>evil()<</x>/script></p>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "<<x>script>evil()<<\/x>\/script>"
2016-10-17 22:47:52 +02:00
} ,
{
"name" : "safe_html_messed_up_complexly_nested_script_tags" ,
"input" : "<scr<script></script>ipt type=\"text/javascript\">alert(\"foo\");</<script></script>script<del></del>>" ,
2017-12-10 09:01:37 +01:00
"expected_output" : "<p><scr<script></script>ipt type=\"text/javascript\">alert(\"foo\");</<script></script>script<del></del>></p>"
2016-10-17 22:47:52 +02:00
} ,
{
"name" : "safe_html_unclosed_tag" ,
"input" : "<script src=http://xx.com/xss.js<b>" ,
"expected_output" : "<p><script src=http://xx.com/xss.js<b></p>" ,
2017-07-29 03:04:17 +02:00
"marked_expected_output" : "<p><script src=http://xx.com/xss.js<b>\n\n</p>"
2016-10-17 22:47:52 +02:00
} ,
{
"name" : "safe_html_unclosed_tag_and_quotes" ,
"input" : "<script src=\"http://xx.com/xss.js\"<b>" ,
"expected_output" : "<p><script src=\"http://xx.com/xss.js\"<b></p>" ,
2017-07-29 03:04:17 +02:00
"marked_expected_output" : "<p><script src="http://xx.com/xss.js"<b>\n\n</p>"
2016-10-17 22:47:52 +02:00
} ,
2014-02-03 17:13:40 +01:00
{
"name" : "safe_html_in_code" ,
"input" : "~~~\n<h1>stay normal</h1>" ,
2020-04-18 03:17:21 +02:00
"expected_output" : "<div class=\"codehilite\"><pre><span></span><code><h1>stay normal</h1>\n</code></pre></div>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "<h1>stay normal<\/h1>\n"
2014-02-05 16:57:23 +01:00
} ,
{
"name" : "ulist_with_inline_code" ,
"input" : "gonna take a break for a bit--all yours if you want to play around too. what I did:\n\n* install cmake\n* git clone zulip desktop\n* run `cmake-gui ..` in `c:\\zulip\\zulip-desktop\\msvcbuild`\n* hit configure/generate until it generated the msvc project (had to make a fix to some cmake files)\n* opened vs2013 \n* tried to build\n" ,
"expected_output" : "<p>gonna take a break for a bit--all yours if you want to play around too. what I did:</p>\n<ul>\n<li>install cmake</li>\n<li>git clone zulip desktop</li>\n<li>run <code>cmake-gui ..</code> in <code>c:\\zulip\\zulip-desktop\\msvcbuild</code></li>\n<li>hit configure/generate until it generated the msvc project (had to make a fix to some cmake files)</li>\n<li>opened vs2013 </li>\n<li>tried to build</li>\n</ul>" ,
2017-10-06 23:16:29 +02:00
"text_content" : "gonna take a break for a bit--all yours if you want to play around too. what I did:\n\ninstall cmake\ngit clone zulip desktop\nrun cmake-gui .. in c:\\zulip\\zulip-desktop\\msvcbuild\nhit configure\/generate until it generated the msvc project (had to make a fix to some cmake files)\nopened vs2013 \ntried to build\n"
2016-08-17 03:09:32 +02:00
} ,
2018-07-18 14:36:04 +02:00
{
2020-06-28 21:50:41 +02:00
"name" : "timestamp_backend_markdown_only" ,
2020-07-06 16:33:14 +02:00
"input" : "<time:Jun 5th 2017, 10:30PM>" ,
2020-06-18 01:32:24 +02:00
"expected_output" : "<p><time datetime=\"2017-06-05T22:30:00Z\">Jun 5th 2017, 10:30PM</time></p>" ,
2020-07-14 23:02:32 +02:00
"marked_expected_output" : "<p><span>Jun 5th 2017, 10:30PM</span></p>" ,
"text_content" : "Jun 5th 2017, 10:30PM"
2018-07-18 14:36:04 +02:00
} ,
{
2020-06-28 21:50:41 +02:00
"name" : "timestamp_backend_markdown_and_marked" ,
2020-07-06 16:33:14 +02:00
"input" : "<time:31 Dec 2017>" ,
2020-07-14 23:02:32 +02:00
"expected_output" : "<p><time datetime=\"2017-12-31T00:00:00Z\">31 Dec 2017</time></p>" ,
"text_content" : "31 Dec 2017"
2018-07-18 14:36:04 +02:00
} ,
{
"name" : "timestamp_invalid_input" ,
2020-07-06 16:33:14 +02:00
"input" : "<time:<alert(1)>>" ,
2020-07-06 17:30:53 +02:00
"expected_output" : "<p><span class=\"timestamp-error\">Invalid time format: <alert(1)</span>></p>" ,
2020-07-14 23:02:32 +02:00
"marked_expected_output" : "<p><span><alert(1)</span>></p>" ,
"text_content" : "Invalid time format: <alert(1)>"
2018-07-18 14:36:04 +02:00
} ,
{
"name" : "timestamp_timezone" ,
2020-07-06 16:33:14 +02:00
"input" : "<time:31 Dec 2017 5:30 am IST>" ,
2020-06-18 01:32:24 +02:00
"expected_output" : "<p><time datetime=\"2017-12-31T00:00:00Z\">31 Dec 2017 5:30 am IST</time></p>" ,
2020-07-14 23:02:32 +02:00
"marked_expected_output" : "<p><span>31 Dec 2017 5:30 am IST</span></p>" ,
"text_content" : "31 Dec 2017 5:30 am IST"
2018-07-18 14:36:04 +02:00
} ,
{
"name" : "timestamp_incorrect" ,
2020-07-06 16:33:14 +02:00
"input" : "<time:**hello world**>" ,
2020-07-06 17:30:53 +02:00
"expected_output" : "<p><span class=\"timestamp-error\">Invalid time format: **hello world**</span></p>" ,
2020-07-14 23:02:32 +02:00
"marked_expected_output" : "<p><span>**hello world**</span></p>" ,
"text_content" : "Invalid time format: **hello world**"
2018-07-18 14:36:04 +02:00
} ,
2024-04-18 17:22:41 +02:00
{
"name" : "timestamp_invalid_timezone" ,
"input" : "<time:1969-12-31T00:00:00+32:00>" ,
"expected_output" : "<p><span class=\"timestamp-error\">Invalid time format: 1969-12-31T00:00:00+32:00</span></p>" ,
"marked_expected_output" : "<p><span>1969-12-31T00:00:00+32:00</span></p>" ,
"text_content" : "Invalid time format: 1969-12-31T00:00:00+32:00"
} ,
2018-07-18 14:36:04 +02:00
{
"name" : "timestamp_unix" ,
2020-07-14 23:02:32 +02:00
"input" : "Let's meet at <time:1496701800>." ,
"expected_output" : "<p>Let's meet at <time datetime=\"2017-06-05T22:30:00Z\">1496701800</time>.</p>" ,
"text_content" : "Let's meet at 1496701800."
2018-07-18 14:36:04 +02:00
} ,
2024-01-05 15:38:08 +01:00
{
"name" : "timestamp_unix_overflow" ,
"input" : "Let's meet at <time:1234567890123>." ,
"expected_output" : "<p>Let's meet at <span class=\"timestamp-error\">Invalid time format: 1234567890123</span>.</p>" ,
"marked_expected_output" : "<p>Let's meet at <time datetime=\"+041091-11-25T05:02:03Z\">1234567890123</time>.</p>" ,
"text_content" : "Let's meet at Invalid time format: 1234567890123."
} ,
2017-03-20 16:56:39 +01:00
{
"name" : "tex_inline" ,
"input" : "$$1 \\oplus 0 = 1$$" ,
2023-11-27 06:23:24 +01:00
"expected_output" : "<p><span class=\"katex\"><span class=\"katex-mathml\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\"><semantics><mrow><mn>1</mn><mo>⊕</mo><mn>0</mn><mo>=</mo><mn>1</mn></mrow><annotation encoding=\"application/x-tex\">1 \\oplus 0 = 1</annotation></semantics></math></span><span class=\"katex-html\" aria-hidden=\"true\"><span class=\"base\"><span class=\"strut\" style=\"height:0.7278em;vertical-align:-0.0833em;\"></span><span class=\"mord\">1</span><span class=\"mspace\" style=\"margin-right:0.2222em;\"></span><span class=\"mbin\">⊕</span><span class=\"mspace\" style=\"margin-right:0.2222em;\"></span></span><span class=\"base\"><span class=\"strut\" style=\"height:0.6444em;\"></span><span class=\"mord\">0</span><span class=\"mspace\" style=\"margin-right:0.2778em;\"></span><span class=\"mrel\">=</span><span class=\"mspace\" style=\"margin-right:0.2778em;\"></span></span><span class=\"base\"><span class=\"strut\" style=\"height:0.6444em;\"></span><span class=\"mord\">1</span></span></span></span></p>" ,
"text_content" : "$$1 \\oplus 0 = 1$$"
2017-03-20 16:56:39 +01:00
} ,
{
"name" : "tex_complex" ,
"input" : "$$\\Phi_E = \\oint E \\cdot dA$$" ,
2021-11-05 01:09:45 +01:00
"expected_output" : "<p><span class=\"katex\"><span class=\"katex-mathml\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\"><semantics><mrow><msub><mi mathvariant=\"normal\">Φ</mi><mi>E</mi></msub><mo>=</mo><mo>∮</mo><mi>E</mi><mo>⋅</mo><mi>d</mi><mi>A</mi></mrow><annotation encoding=\"application/x-tex\">\\Phi_E = \\oint E \\cdot dA</annotation></semantics></math></span><span class=\"katex-html\" aria-hidden=\"true\"><span class=\"base\"><span class=\"strut\" style=\"height:0.8333em;vertical-align:-0.15em;\"></span><span class=\"mord\"><span class=\"mord\">Φ</span><span class=\"msupsub\"><span class=\"vlist-t vlist-t2\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height:0.3283em;\"><span style=\"top:-2.55em;margin-left:0em;margin-right:0.05em;\"><span class=\"pstrut\" style=\"height:2.7em;\"></span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mathnormal mtight\" style=\"margin-right:0.05764em;\">E</span></span></span></span><span class=\"vlist-s\"> </span></span><span class=\"vlist-r\"><span class=\"vlist\" style=\"height:0.15em;\"><span></span></span></span></span></span></span><span class=\"mspace\" style=\"margin-right:0.2778em;\"></span><span class=\"mrel\">=</span><span class=\"mspace\" style=\"margin-right:0.2778em;\"></span></span><span class=\"base\"><span class=\"strut\" style=\"height:1.1111em;vertical-align:-0.3061em;\"></span><span class=\"mop op-symbol small-op\" style=\"margin-right:0.19445em;position:relative;top:-0.0006em;\">∮</span><span class=\"mspace\" style=\"margin-right:0.1667em;\"></span><span class=\"mord mathnormal\" style=\"margin-right:0.05764em;\">E</span><span class=\"mspace\" style=\"margin-right:0.2222em;\"></span><span class=\"mbin\">⋅</span><span class=\"mspace\" style=\"margin-right:0.2222em;\"></span></span><span class=\"base\"><span class=\"strut\" style=\"height:0.6944em;\"></span><span class=\"mord mathnormal\">d</span><span class=\"mord mathnormal\">A</span></span></span></span></p>"
2017-03-20 16:56:39 +01:00
} ,
{
"name" : "tex_escaped" ,
"input" : "`$$a$$`" ,
2017-11-07 21:01:57 +01:00
"expected_output" : "<p><code>$$a$$</code></p>"
2017-03-20 16:56:39 +01:00
} ,
{
"name" : "tex_fenced_math" ,
"input" : "```math\na^2 = b^2 + c^2\n```" ,
2023-11-27 06:23:24 +01:00
"expected_output" : "<p><span class=\"katex-display\"><span class=\"katex\"><span class=\"katex-mathml\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><msup><mi>a</mi><mn>2</mn></msup><mo>=</mo><msup><mi>b</mi><mn>2</mn></msup><mo>+</mo><msup><mi>c</mi><mn>2</mn></msup></mrow><annotation encoding=\"application/x-tex\">a^2 = b^2 + c^2</annotation></semantics></math></span><span class=\"katex-html\" aria-hidden=\"true\"><span class=\"base\"><span class=\"strut\" style=\"height:0.8641em;\"></span><span class=\"mord\"><span class=\"mord mathnormal\">a</span><span class=\"msupsub\"><span class=\"vlist-t\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height:0.8641em;\"><span style=\"top:-3.113em;margin-right:0.05em;\"><span class=\"pstrut\" style=\"height:2.7em;\"></span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mtight\">2</span></span></span></span></span></span></span></span><span class=\"mspace\" style=\"margin-right:0.2778em;\"></span><span class=\"mrel\">=</span><span class=\"mspace\" style=\"margin-right:0.2778em;\"></span></span><span class=\"base\"><span class=\"strut\" style=\"height:0.9474em;vertical-align:-0.0833em;\"></span><span class=\"mord\"><span class=\"mord mathnormal\">b</span><span class=\"msupsub\"><span class=\"vlist-t\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height:0.8641em;\"><span style=\"top:-3.113em;margin-right:0.05em;\"><span class=\"pstrut\" style=\"height:2.7em;\"></span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mtight\">2</span></span></span></span></span></span></span></span><span class=\"mspace\" style=\"margin-right:0.2222em;\"></span><span class=\"mbin\">+</span><span class=\"mspace\" style=\"margin-right:0.2222em;\"></span></span><span class=\"base\"><span class=\"strut\" style=\"height:0.8641em;\"></span><span class=\"mord\"><span class=\"mord mathnormal\">c</span><span class=\"msupsub\"><span class=\"vlist-t\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height:0.8641em;\"><span style=\"top:-3.113em;margin-right:0.05em;\"><span class=\"pstrut\" style=\"height:2.7em;\"></span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mtight\">2</span></span></span></span></span></span></span></span></span></span></span></span></p>" ,
"text_content" : "$$a^2 = b^2 + c^2$$"
2017-03-20 16:56:39 +01:00
} ,
{
"name" : "tex_fenced_tex" ,
"input" : "```tex\n\n\\pi \\textbf{ is not } 3.14\n```" ,
2020-09-15 16:29:35 +02:00
"expected_output" : "<div class=\"codehilite\" data-code-language=\"TeX\"><pre><span></span><code><span class=\"k\">\\pi</span> <span class=\"k\">\\textbf</span><span class=\"nb\">{</span> is not <span class=\"nb\">}</span> 3.14\n</code></pre></div>" ,
2020-09-06 11:52:11 +02:00
"marked_expected_output" : "<div class=\"codehilite\" data-code-language=\"TeX\"><pre><span></span><code>\\pi \\textbf{ is not } 3.14\n</code></pre></div>"
2017-03-20 16:56:39 +01:00
} ,
{
"name" : "tex_fenced_latex" ,
2020-05-21 03:42:12 +02:00
"input" : "```latex\n\n\\pi \\textbf{ is not } 3.14\n```" ,
2020-09-15 16:29:35 +02:00
"expected_output" : "<div class=\"codehilite\" data-code-language=\"TeX\"><pre><span></span><code><span class=\"k\">\\pi</span> <span class=\"k\">\\textbf</span><span class=\"nb\">{</span> is not <span class=\"nb\">}</span> 3.14\n</code></pre></div>" ,
2020-09-06 11:52:11 +02:00
"marked_expected_output" : "<div class=\"codehilite\" data-code-language=\"TeX\"><pre><span></span><code>\\pi \\textbf{ is not } 3.14\n</code></pre></div>"
2017-03-20 16:56:39 +01:00
} ,
{
"name" : "tex_money" ,
"input" : "Tickets are $5 to $20 for youth, $10-$30 for adults, so we are hoping to bring in $500 from the event ($$x \\approx 500\\$$$)" ,
2021-11-05 01:09:45 +01:00
"expected_output" : "<p>Tickets are $5 to $20 for youth, $10-$30 for adults, so we are hoping to bring in $500 from the event (<span class=\"katex\"><span class=\"katex-mathml\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\"><semantics><mrow><mi>x</mi><mo>≈</mo><mn>500</mn><mi mathvariant=\"normal\">$</mi></mrow><annotation encoding=\"application/x-tex\">x \\approx 500\\$</annotation></semantics></math></span><span class=\"katex-html\" aria-hidden=\"true\"><span class=\"base\"><span class=\"strut\" style=\"height:0.4831em;\"></span><span class=\"mord mathnormal\">x</span><span class=\"mspace\" style=\"margin-right:0.2778em;\"></span><span class=\"mrel\">≈</span><span class=\"mspace\" style=\"margin-right:0.2778em;\"></span></span><span class=\"base\"><span class=\"strut\" style=\"height:0.8056em;vertical-align:-0.0556em;\"></span><span class=\"mord\">500$</span></span></span></span>)</p>"
2017-03-20 16:56:39 +01:00
} ,
2017-11-23 19:39:58 +01:00
{
"name" : "tex_inline_permissive_spacing" ,
"input" : "$$ x = 7 $$" ,
2021-11-05 01:09:45 +01:00
"expected_output" : "<p><span class=\"katex\"><span class=\"katex-mathml\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\"><semantics><mrow><mi>x</mi><mo>=</mo><mn>7</mn></mrow><annotation encoding=\"application/x-tex\"> x = 7 </annotation></semantics></math></span><span class=\"katex-html\" aria-hidden=\"true\"><span class=\"base\"><span class=\"strut\" style=\"height:0.4306em;\"></span><span class=\"mord mathnormal\">x</span><span class=\"mspace\" style=\"margin-right:0.2778em;\"></span><span class=\"mrel\">=</span><span class=\"mspace\" style=\"margin-right:0.2778em;\"></span></span><span class=\"base\"><span class=\"strut\" style=\"height:0.6444em;\"></span><span class=\"mord\">7</span></span></span></span></p>"
2017-11-23 19:39:58 +01:00
} ,
{
"name" : "tex_inline_prohibited_newline" ,
"input" : "$$x=3\ny=4$$" ,
"expected_output" : "<p>$$x=3<br>\ny=4$$</p>"
} ,
2017-03-20 16:56:39 +01:00
{
"name" : "tex_dollar_smiley" ,
"input" : "$$_$$ is a fun money-related smiley!" ,
2017-11-07 21:01:57 +01:00
"expected_output" : "<p>$$_$$ is a fun money-related smiley!</p>"
2017-03-20 16:56:39 +01:00
} ,
{
"name" : "tex_multiple_dollars" ,
"input" : "We are going to make some $$$ or maybe even $$$$!" ,
2017-11-07 21:01:57 +01:00
"expected_output" : "<p>We are going to make some $$$ or maybe even $$$$!</p>"
2017-03-20 16:56:39 +01:00
} ,
{
"name" : "tex_non_matching_dollar_count" ,
"input" : "$foo is$$" ,
2017-11-07 21:01:57 +01:00
"expected_output" : "<p>$foo is$$</p>"
2017-03-20 16:56:39 +01:00
} ,
{
"name" : "tex_safe_script_tag" ,
"input" : "$$<script type='text/javascript'>alert('xss');</script>$$\n\n~~~math\n<script type='text/javascript'>alert('xss');</script>\n~~~" ,
2021-11-05 01:09:45 +01:00
"expected_output" : "<p><span class=\"katex\"><span class=\"katex-mathml\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\"><semantics><mrow><mo><</mo><mi>s</mi><mi>c</mi><mi>r</mi><mi>i</mi><mi>p</mi><mi>t</mi><mi>t</mi><mi>y</mi><mi>p</mi><mi>e</mi><msup><mo>=</mo><mo mathvariant=\"normal\" lspace=\"0em\" rspace=\"0em\">\u2032</mo></msup><mi>t</mi><mi>e</mi><mi>x</mi><mi>t</mi><mi mathvariant=\"normal\">/</mi><mi>j</mi><mi>a</mi><mi>v</mi><mi>a</mi><mi>s</mi><mi>c</mi><mi>r</mi><mi>i</mi><mi>p</mi><msup><mi>t</mi><mo mathvariant=\"normal\" lspace=\"0em\" rspace=\"0em\">\u2032</mo></msup><mo>></mo><mi>a</mi><mi>l</mi><mi>e</mi><mi>r</mi><mi>t</mi><msup><mo stretchy=\"false\">(</mo><mo mathvariant=\"normal\" lspace=\"0em\" rspace=\"0em\">\u2032</mo></msup><mi>x</mi><mi>s</mi><msup><mi>s</mi><mo mathvariant=\"normal\" lspace=\"0em\" rspace=\"0em\">\u2032</mo></msup><mo stretchy=\"false\">)</mo><mo separator=\"true\">;</mo><mo><</mo><mi mathvariant=\"normal\">/</mi><mi>s</mi><mi>c</mi><mi>r</mi><mi>i</mi><mi>p</mi><mi>t</mi><mo>></mo></mrow><annotation encoding=\"application/x-tex\"><script type='text/javascript'>alert('xss');</script></annotation></semantics></math></span><span class=\"katex-html\" aria-hidden=\"true\"><span class=\"base\"><span class=\"strut\" style=\"height:0.5782em;vertical-align:-0.0391em;\"></span><span class=\"mrel\"><</span><span class=\"mspace\" style=\"margin-right:0.2778em;\"></span></span><span class=\"base\"><span class=\"strut\" style=\"height:0.9463em;vertical-align:-0.1944em;\"></span><span class=\"mord mathnormal\" style=\"margin-right:0.02778em;\">scr</span><span class=\"mord mathnormal\">i</span><span class=\"mord mathnormal\">ptt</span><span class=\"mord mathnormal\" style=\"margin-right:0.03588em;\">y</span><span class=\"mord mathnormal\">p</span><span class=\"mord mathnormal\">e</span><span class=\"mspace\" style=\"margin-right:0.2778em;\"></span><span class=\"mrel\"><span class=\"mrel\">=</span><span class=\"msupsub\"><span class=\"vlist-t\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height:0.7519em;\"><span style=\"top:-3.063em;margin-right:0.05em;\"><span class=\"pstrut\" style=\"height:2.7em;\"></span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mtight\"><span class=\"mord mtight\">\u2032</span></span></span></span></span></span></span></span></span><span class=\"mspace\" style=\"margin-right:0.2778em;\"></span></span><span class=\"base\"><span class=\"strut\" style=\"height:1.0019em;vertical-align:-0.25em;\"></span><span class=\"mord mathnormal\">t</span><span class=\"mord mathnormal\">e</span><span class=\"mord mathnormal\">x</span><span class=\"mord mathnormal\">t</span><span class=\"mord\">/</span><span class=\"mord mathnormal\">ja</span><span class=\"mord mathnormal\" style=\"margin-right:0.03588em;\">v</span><span class=\"mord mathnormal\">a</span><span class=\"mord mathnormal\" style=\"margin-right:0.02778em;\">scr</span><span class=\"mord mathnormal\">i</span><span class=\"mord mathnormal\">p</span><span class=\"mord\"><span class=\"mord mathnormal\">t</span><span class=\"msupsub\"><span class=\"vlist-t\"><span class=\"vlist-r\"><span class=\"vlist\" style=\"height:0.7519em;\"><span style=\"top:-3.063em;margin-right:0.05em;\"><span class=\"pstrut\" style=\"height:2.7em;\"></span><span class=\"sizing reset-size6 size3 mtight\"><span class=\"mord mtight\"><span class=\"mord mtight\">\u2032</span></span></span></span></span></span></span></span></span><span class=\"mspace\" style=\"margin-right:0.2778em;\"></span><span class=\"mrel\">></span><span class=\"mspace\" style=\"margin-right:0.2778em;\"></span></span><span class=\"base\"><span class=\"strut\" style=\"height:1.0019em;vertical-align:-0.25em;\"></span><span class=\"mord mathnormal\">a</span><span class=\"mord mathnormal\" style=\"margin-right:0.01968em;\">l</span><span class=\"mord mathnormal\" style=\"margin-right:0.02778em;\">er</span><span class=\"mord mathnormal\">t</span><span class=\"mopen\"><span class=\"mopen\" > ( < / s p a n > < s
2017-03-20 16:56:39 +01:00
} ,
{
"name" : "tex_error_safe_script_tag" ,
"input" : "$$\\<script type='text/javascript'>alert('xss');</script>$$\n\n~~~math\n\\<script type='text/javascript'>alert('xss');</script>\n~~~" ,
2021-05-02 00:06:30 +02:00
"expected_output" : "<p><span class=\"tex-error\">$$\\<script type='text/javascript'>alert('xss');</script>$$</span></p>\n<p><span class=\"tex-error\">\\<script type='text/javascript'>alert('xss');</script></span></p>"
2019-03-01 19:46:24 +01:00
} ,
2021-05-01 23:51:19 +02:00
{
"name" : "tex_inline_no_markdown_inside" ,
"input" : "$$\\text{**a**}$$" ,
2021-11-05 01:09:45 +01:00
"expected_output" : "<p><span class=\"katex\"><span class=\"katex-mathml\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\"><semantics><mrow><mtext>**a**</mtext></mrow><annotation encoding=\"application/x-tex\">\\text{**a**}</annotation></semantics></math></span><span class=\"katex-html\" aria-hidden=\"true\"><span class=\"base\"><span class=\"strut\" style=\"height:0.75em;\"></span><span class=\"mord text\"><span class=\"mord\">**a**</span></span></span></span></span></p>"
2021-05-01 23:51:19 +02:00
} ,
{
"name" : "tex_display_no_markdown_inside" ,
"input" : "~~~math\n\\text{**a**}\n~~~" ,
2021-11-05 01:09:45 +01:00
"expected_output" : "<p><span class=\"katex-display\"><span class=\"katex\"><span class=\"katex-mathml\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mtext>**a**</mtext></mrow><annotation encoding=\"application/x-tex\">\\text{**a**}</annotation></semantics></math></span><span class=\"katex-html\" aria-hidden=\"true\"><span class=\"base\"><span class=\"strut\" style=\"height:0.75em;\"></span><span class=\"mord text\"><span class=\"mord\">**a**</span></span></span></span></span></span></p>"
2021-05-01 23:51:19 +02:00
} ,
{
"name" : "tex_inline_error_no_markdown_inside" ,
"input" : "$$\\error{**a**}$$" ,
"expected_output" : "<p><span class=\"tex-error\">$$\\error{**a**}$$</span></p>"
} ,
{
"name" : "tex_display_error_no_markdown_inside" ,
"input" : "~~~math\n\\error{**a**}\n~~~" ,
"expected_output" : "<p><span class=\"tex-error\">\\error{**a**}</span></p>"
} ,
2019-03-01 19:46:24 +01:00
{
"name" : "auto_renumbered_list_blankline" ,
"input" : "1. A\n\n1. B\n\n1. C\n\n1. D\nordinary paragraph\n1. AA\n\n1. BB" ,
2019-08-11 07:41:34 +02:00
"expected_output" : "<ol>\n<li>\n<p>A</p>\n</li>\n<li>\n<p>B</p>\n</li>\n<li>\n<p>C</p>\n</li>\n<li>\n<p>D<br>\nordinary paragraph</p>\n</li>\n<li>\n<p>AA</p>\n</li>\n<li>\n<p>BB</p>\n</li>\n</ol>" ,
"marked_expected_output" : "<ol>\n<li><p>A</p>\n</li>\n<li><p>B</p>\n</li>\n<li><p>C</p>\n</li>\n<li><p>D<br>\nordinary paragraph</p>\n</li>\n<li><p>AA</p>\n</li>\n<li><p>BB</p>\n</li>\n</ol>" ,
"text_content" : "1. A\n2. B\n3. C\n4. D\nordinary paragraph\n5. AA\n6. BB"
2020-04-04 22:14:34 +02:00
} ,
{
"name" : "spoilers_fenced_spoiler" ,
"input" : "```spoiler header\ncontent\n```\noutside spoiler\n" ,
2020-10-19 04:49:17 +02:00
"expected_output" : "<div class=\"spoiler-block\"><div class=\"spoiler-header\">\n<p>header</p>\n</div><div class=\"spoiler-content\" aria-hidden=\"true\">\n<p>content</p>\n</div></div>\n<p>outside spoiler</p>" ,
2020-07-16 06:33:11 +02:00
"text_content" : "header (…)\noutside spoiler"
2020-04-04 22:14:34 +02:00
} ,
{
"name" : "spoilers_empty_header" ,
"input" : "```spoiler\ncontent\n```\noutside spoiler\n" ,
2020-10-19 04:49:17 +02:00
"expected_output" : "<div class=\"spoiler-block\"><div class=\"spoiler-header\">\n</div><div class=\"spoiler-content\" aria-hidden=\"true\">\n<p>content</p>\n</div></div>\n<p>outside spoiler</p>" ,
2020-07-16 06:33:11 +02:00
"text_content" : "(…)\noutside spoiler"
2020-04-04 22:14:34 +02:00
} ,
{
"name" : "spoilers_script_tags" ,
"input" : "```spoiler <script>alert(1)</script>\n<script>alert(1)</script>\n```" ,
2020-10-19 04:49:17 +02:00
"expected_output" : "<div class=\"spoiler-block\"><div class=\"spoiler-header\">\n<p><script>alert(1)</script></p>\n</div><div class=\"spoiler-content\" aria-hidden=\"true\">\n<p><script>alert(1)</script></p>\n</div></div>" ,
"marked_expected_output" : "<div class=\"spoiler-block\"><div class=\"spoiler-header\">\n<p><script>alert(1)</script>\n\n</p>\n</div><div class=\"spoiler-content\" aria-hidden=\"true\">\n<p><script>alert(1)</script>\n\n</p>\n</div></div>" ,
2020-07-16 06:33:11 +02:00
"text_content" : "<script>alert(1)</script> (…)\n"
2020-04-04 22:14:34 +02:00
} ,
{
"name" : "spoilers_block_quote" ,
"input" : "~~~quote\n```spoiler header\ncontent\n```\noutside spoiler\n~~~\noutside quote" ,
2020-10-19 04:49:17 +02:00
"expected_output" : "<blockquote>\n<div class=\"spoiler-block\"><div class=\"spoiler-header\">\n<p>header</p>\n</div><div class=\"spoiler-content\" aria-hidden=\"true\">\n<p>content</p>\n</div></div>\n<p>outside spoiler</p>\n</blockquote>\n<p>outside quote</p>" ,
2024-06-12 17:13:34 +02:00
"text_content" : "[…]outside quote"
2020-04-04 22:14:34 +02:00
} ,
{
"name" : "spoilers_with_header_markdown" ,
"input" : "```spoiler [Header](https://example.com) :smile:\ncontent\n```" ,
2020-10-19 04:49:17 +02:00
"expected_output" : "<div class=\"spoiler-block\"><div class=\"spoiler-header\">\n<p><a href=\"https://example.com\">Header</a> <span aria-label=\"smile\" class=\"emoji emoji-1f642\" role=\"img\" title=\"smile\">:smile:</span></p>\n</div><div class=\"spoiler-content\" aria-hidden=\"true\">\n<p>content</p>\n</div></div>" ,
2020-06-30 21:16:29 +02:00
"text_content" : "Header 🙂 (…)\n"
2020-04-04 22:14:34 +02:00
} ,
{
"name" : "spoiler_with_inline_image" ,
"input" : "```spoiler header\nContent http://example.com/image.png\n```" ,
2020-10-19 04:49:17 +02:00
"expected_output" : "<div class=\"spoiler-block\"><div class=\"spoiler-header\">\n<p>header</p>\n</div><div class=\"spoiler-content\" aria-hidden=\"true\">\n<p>Content <a href=\"http://example.com/image.png\">http://example.com/image.png</a></p>\n<div class=\"message_inline_image\"><a href=\"http://example.com/image.png\"><img data-src-fullsize=\"/thumbnail?url=http%3A%2F%2Fexample.com%2Fimage.png&size=full\" src=\"/thumbnail?url=http%3A%2F%2Fexample.com%2Fimage.png&size=thumbnail\"></a></div></div></div>" ,
"marked_expected_output" : "<div class=\"spoiler-block\"><div class=\"spoiler-header\">\n<p>header</p>\n</div><div class=\"spoiler-content\" aria-hidden=\"true\">\n<p>Content <a href=\"http://example.com/image.png\">http://example.com/image.png</a></p>\n</div></div>" ,
2020-07-16 06:33:11 +02:00
"text_content" : "header (…)\n"
2020-11-04 22:56:09 +01:00
} ,
{
"name" : "embedded_link_inside_Bold" ,
"input" : "**[Static types in Python](https://blog.zulip.com/2016/10/13/static-types-in-python-oh-mypy)**" ,
"expected_output" : "<p><strong><a href=\"https://blog.zulip.com/2016/10/13/static-types-in-python-oh-mypy\">Static types in Python</a></strong></p>"
} ,
{
"name" : "embedded_link_inside_Italic" ,
"input" : "*[Static types in Python](https://blog.zulip.com/2016/10/13/static-types-in-python-oh-mypy)*" ,
"expected_output" : "<p><em><a href=\"https://blog.zulip.com/2016/10/13/static-types-in-python-oh-mypy\">Static types in Python</a></em></p>"
} ,
{
"name" : "edge_case_embedded_link_inside_Bold" ,
"input" : "<h1>**<h1>[<h2>Static types in Python</h2>](https://blog.zulip.com/2016/10/13/static-types-in-python-oh-mypy)</h1>**</h1>" ,
"expected_output" : "<p><h1><strong><h1><a href=\"https://blog.zulip.com/2016/10/13/static-types-in-python-oh-mypy\"><h2>Static types in Python</h2></a></h1></strong></h1></p>" ,
"marked_expected_output" : "<p><h1><strong><h1><a href=\"https://blog.zulip.com/2016/10/13/static-types-in-python-oh-mypy\"><h2>Static types in Python</h2></a></h1></strong></h1>\n\n</p>"
} ,
{
"name" : "edge_case_embedded_link_inside_Italic" ,
"input" : "<h1>*<h1>[<h2>Static types in Python</h2>](https://blog.zulip.com/2016/10/13/static-types-in-python-oh-mypy)</h1>*</h1>" ,
"expected_output" : "<p><h1><em><h1><a href=\"https://blog.zulip.com/2016/10/13/static-types-in-python-oh-mypy\"><h2>Static types in Python</h2></a></h1></em></h1></p>" ,
"marked_expected_output" : "<p><h1><em><h1><a href=\"https://blog.zulip.com/2016/10/13/static-types-in-python-oh-mypy\"><h2>Static types in Python</h2></a></h1></em></h1>\n\n</p>"
2021-05-08 19:40:47 +02:00
} ,
{
"name" : "telephone_sms_link" ,
"input" : "[call me](tel:+14155551234) [or maybe not](sms:+14155551234)" ,
"expected_output" : "<p><a href=\"tel:+14155551234\">call me</a> <a href=\"sms:+14155551234\">or maybe not</a></p>"
2021-05-26 13:23:30 +02:00
} ,
{
"name" : "codeblock_hilite_shebang_feature_no_path_1" ,
"input" : "```\n#!python\nprint(\"Hello World\")\n```" ,
"expected_output" : "<div class=\"codehilite\"><pre><span></span><code><span class=\"ch\">#!python</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s2\">"Hello World"</span><span class=\"p\">)</span>\n</code></pre></div>" ,
"marked_expected_output" : "<div class=\"codehilite\"><pre><span></span><code>#!python\nprint("Hello World")\n</code></pre></div>"
} ,
{
"name" : "codeblock_hilite_shebang_feature_no_path_2" ,
"input" : "```\n:::python\nprint(\"Hello World\")\n```" ,
"expected_output" : "<div class=\"codehilite\"><pre><span></span><code><span class=\"p\">:::</span><span class=\"n\">python</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s2\">"Hello World"</span><span class=\"p\">)</span>\n</code></pre></div>" ,
"marked_expected_output" : "<div class=\"codehilite\"><pre><span></span><code>:::python\nprint("Hello World")\n</code></pre></div>"
} ,
{
"name" : "codeblock_hilite_shebang_feature_with_path" ,
"input" : "```\n#!/usr/bin/python\nprint(\"Hello World\")\n```" ,
"expected_output" : "<div class=\"codehilite\"><pre><span></span><code><span class=\"ch\">#!/usr/bin/python</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s2\">"Hello World"</span><span class=\"p\">)</span>\n</code></pre></div>" ,
"marked_expected_output" : "<div class=\"codehilite\"><pre><span></span><code>#!/usr/bin/python\nprint("Hello World")\n</code></pre></div>"
2023-08-19 20:10:01 +02:00
} ,
{
"name" : "codeblock_hilite_startinline_php" ,
"input" : "```php\n $var = function($var, 'string');\n```\nPHP\n```css+php\n $var = function($var, 'string');\n```\nCSS + PHP\n```html+php\n $var = function($var, 'string');\n```\nHTML + PHP\n```javascript+php\n $var = function($var, 'string');\n```\nJAVASCRIPT + PHP\n```xml+php\n $var = function($var, 'string');\n```\nXML + PHP\n```php\n <?php\n $var = function($var, 'string');\n```\nWITH MARKER" ,
"expected_output" : "<div class=\"codehilite\" data-code-language=\"PHP\"><pre><span></span><code> <span class=\"nv\">$var</span> <span class=\"o\">=</span> <span class=\"k\">function</span><span class=\"p\">(</span><span class=\"nv\">$var</span><span class=\"p\">,</span> <span class=\"s1\">'string'</span><span class=\"p\">);</span>\n</code></pre></div>\n<p>PHP</p>\n<div class=\"codehilite\" data-code-language=\"CSS+PHP\"><pre><span></span><code> <span class=\"nv\">$var</span> <span class=\"o\">=</span> <span class=\"k\">function</span><span class=\"p\">(</span><span class=\"nv\">$var</span><span class=\"p\">,</span> <span class=\"s1\">'string'</span><span class=\"p\">);</span>\n</code></pre></div>\n<p>CSS + PHP</p>\n<div class=\"codehilite\" data-code-language=\"HTML+PHP\"><pre><span></span><code> <span class=\"nv\">$var</span> <span class=\"o\">=</span> <span class=\"k\">function</span><span class=\"p\">(</span><span class=\"nv\">$var</span><span class=\"p\">,</span> <span class=\"s1\">'string'</span><span class=\"p\">);</span>\n</code></pre></div>\n<p>HTML + PHP</p>\n<div class=\"codehilite\" data-code-language=\"JavaScript+PHP\"><pre><span></span><code> <span class=\"nv\">$var</span> <span class=\"o\">=</span> <span class=\"k\">function</span><span class=\"p\">(</span><span class=\"nv\">$var</span><span class=\"p\">,</span> <span class=\"s1\">'string'</span><span class=\"p\">);</span>\n</code></pre></div>\n<p>JAVASCRIPT + PHP</p>\n<div class=\"codehilite\" data-code-language=\"XML+PHP\"><pre><span></span><code> <span class=\"nv\">$var</span> <span class=\"o\">=</span> <span class=\"k\">function</span><span class=\"p\">(</span><span class=\"nv\">$var</span><span class=\"p\">,</span> <span class=\"s1\">'string'</span><span class=\"p\">);</span>\n</code></pre></div>\n<p>XML + PHP</p>\n<div class=\"codehilite\" data-code-language=\"PHP\"><pre><span></span><code> <span class=\"o\"><?</span><span class=\"nx\">php</span>\n <span class=\"nv\">$var</span> <span class=\"o\">=</span> <span class=\"k\">function</span><span class=\"p\">(</span><span class=\"nv\">$var</span><span class=\"p\">,</span> <span class=\"s1\">'string'</span><span class=\"p\">);</span>\n</code></pre></div>\n<p>WITH MARKER</p>" ,
"marked_expected_output" : "<div class=\"codehilite\" data-code-language=\"PHP\"><pre><span></span><code> $var = function($var, 'string');\n</code></pre></div>\n<p>PHP</p>\n<div class=\"codehilite\" data-code-language=\"CSS+PHP\"><pre><span></span><code> $var = function($var, 'string');\n</code></pre></div>\n<p>CSS + PHP</p>\n<div class=\"codehilite\" data-code-language=\"HTML+PHP\"><pre><span></span><code> $var = function($var, 'string');\n</code></pre></div>\n<p>HTML + PHP</p>\n<div class=\"codehilite\" data-code-language=\"JavaScript+PHP\"><pre><span></span><code> $var = function($var, 'string');\n</code></pre></div>\n<p>JAVASCRIPT + PHP</p>\n<div class=\"codehilite\" data-code-language=\"XML+PHP\"><pre><span></span><code> $var = function($var, 'string');\n</code></pre></div>\n<p>XML + PHP</p>\n<div class=\"codehilite\" data-code-language=\"PHP\"><pre><span></span><code> <?php\n $var = function($var, 'string');\n</code></pre></div>\n<p>WITH MARKER</p>"
2024-06-12 17:13:34 +02:00
} ,
{
"name" : "normal_quote_and_reply" ,
"input" : "@_**Zoe|7** [said](http://zulip.testserver/#narrow/stream/13-social/topic/party/near/103):\n```quote\nHow are you?\n```\n\nGreat" ,
"expected_output" : "<p><span class=\"user-mention silent\" data-user-id=\"7\">Zoe</span> <a href=\"#narrow/stream/13-social/topic/party/near/103\">said</a>:</p>\n<blockquote>\n<p>How are you?</p>\n</blockquote>\n<p>Great</p>" ,
"marked_expected_output" : "<p><span class=\"user-mention silent\" data-user-id=\"7\">Zoe</span> <a href=\"http://zulip.testserver/#narrow/stream/13-social/topic/party/near/103\">said</a>:</p>\n<blockquote>\n<p>How are you?</p>\n</blockquote>\n<p>Great</p>" ,
"text_content" : "[…]\nGreat"
} ,
{
"name" : "user_mention_with_no_message_link" ,
"input" : "Hello @_**Zoe|7** see [this](http://zulip.testserver/#narrow/search/database)." ,
"expected_output" : "<p>Hello <span class=\"user-mention silent\" data-user-id=\"7\">Zoe</span> see <a href=\"#narrow/search/database\">this</a>.</p>" ,
"marked_expected_output" : "<p>Hello <span class=\"user-mention silent\" data-user-id=\"7\">Zoe</span> see <a href=\"http://zulip.testserver/#narrow/search/database\">this</a>.</p>" ,
"text_content" : "Hello Zoe see this."
} ,
{
"name" : "user_mention_with_no_narrow_link" ,
"input" : "Hello @_**Zoe|7** see [this](https://google.com)." ,
"expected_output" : "<p>Hello <span class=\"user-mention silent\" data-user-id=\"7\">Zoe</span> see <a href=\"https://google.com\">this</a>.</p>" ,
"text_content" : "Hello Zoe see this."
2014-01-17 21:08:45 +01:00
}
] ,
"linkify_tests" : [
[
"http://www.google.com" ,
"<p>%s</p>" ,
"http://www.google.com"
] ,
[
"https://www.google.com" ,
"<p>%s</p>" ,
"https://www.google.com"
] ,
[
"http://www.theregister.co.uk/foo/bar" ,
"<p>%s</p>" ,
"http://www.theregister.co.uk/foo/bar"
] ,
[
" some text https://www.google.com/" ,
"<p>some text %s</p>" ,
"https://www.google.com/"
] ,
[
"with short example.com url" ,
"<p>with short %s url</p>" ,
"example.com"
] ,
[
"t.co" ,
"<p>%s</p>" ,
"t.co"
] ,
2016-12-30 03:15:48 +01:00
[
"readme.md" ,
"<p>readme.md</p>" ,
"readme.md"
] ,
2014-01-17 21:08:45 +01:00
[
"go to views.org please" ,
"<p>go to %s please</p>" ,
"views.org"
] ,
[
"http://foo.com/blah_blah/" ,
"<p>%s</p>" ,
"http://foo.com/blah_blah/"
] ,
[
"python class views.py is" ,
"<p>python class views.py is</p>" ,
""
] ,
[
"with www www.zulip.com/foo ok?" ,
"<p>with www %s ok?</p>" ,
"www.zulip.com/foo"
] ,
[
"allow questions like foo.com?" ,
"<p>allow questions like %s?</p>" ,
"foo.com"
] ,
[
"\"is.gd/foo/ \"" ,
"<p>\"%s \"</p>" ,
"is.gd/foo/"
] ,
[
"end of sentence https://t.co." ,
"<p>end of sentence %s.</p>" ,
"https://t.co"
] ,
[
"(Something like http://foo.com/blah_blah)" ,
"<p>(Something like %s)</p>" ,
"http://foo.com/blah_blah"
] ,
[
"\"is.gd/foo/\"" ,
"<p>\"%s\"</p>" ,
"is.gd/foo/"
] ,
[
"end with a quote www.google.com\"" ,
"<p>end with a quote %s\"</p>" ,
"www.google.com"
] ,
2014-03-05 21:17:48 +01:00
[
"end with an exclamation www.google.com!" ,
"<p>end with an exclamation %s!</p>" ,
"www.google.com"
] ,
2014-01-17 21:08:45 +01:00
[
"http://www.guardian.co.uk/foo/bar" ,
"<p>%s</p>" ,
"http://www.guardian.co.uk/foo/bar"
] ,
[
"from http://supervisord.org/running.html:" ,
"<p>from %s:</p>" ,
"http://supervisord.org/running.html"
] ,
[
"http://raven.io" ,
"<p>%s</p>" ,
"http://raven.io"
] ,
[
"at https://zulip.com/api. Check it!" ,
"<p>at %s. Check it!</p>" ,
"https://zulip.com/api"
] ,
[
"goo.gl/abc" ,
"<p>%s</p>" ,
"goo.gl/abc"
] ,
[
"I spent a year at ucl.ac.uk" ,
"<p>I spent a year at %s</p>" ,
"ucl.ac.uk"
] ,
[
"http://a.cc/i/FMXO" ,
"<p>%s</p>" ,
"http://a.cc/i/FMXO"
] ,
[
"http://fmota.eu/blog/test.html" ,
"<p>%s</p>" ,
"http://fmota.eu/blog/test.html"
] ,
[
"http://j.mp/14Hwm3X" ,
"<p>%s</p>" ,
"http://j.mp/14Hwm3X"
] ,
[
"http://localhost:9991/?show_debug=1" ,
"<p>%s</p>" ,
"http://localhost:9991/?show_debug=1"
] ,
[
"anyone before? (http://a.cc/i/FMXO)" ,
"<p>anyone before? (%s)</p>" ,
"http://a.cc/i/FMXO"
] ,
[
"(http://en.wikipedia.org/wiki/Each-way_(bet))" ,
"<p>(%s)</p>" ,
"http://en.wikipedia.org/wiki/Each-way_(bet)"
] ,
[
"(http://en.wikipedia.org/wiki/Each-way_(bet)_(more_parens))" ,
"<p>(%s)</p>" ,
"http://en.wikipedia.org/wiki/Each-way_(bet)_(more_parens)"
] ,
[
"http://en.wikipedia.org/wiki/Qt_(framework)" ,
"<p>%s</p>" ,
"http://en.wikipedia.org/wiki/Qt_(framework)"
] ,
[
"http://fr.wikipedia.org/wiki/Fichier:SMirC-facepalm.svg" ,
"<p>%s</p>" ,
"http://fr.wikipedia.org/wiki/Fichier:SMirC-facepalm.svg"
] ,
[
"https://jira.atlassian.com/browse/JRA-31953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel" ,
"<p>%s</p>" ,
"https://jira.atlassian.com/browse/JRA-31953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel"
] ,
[
"http://web.archive.org/web/20120630032016/http://web.mit.edu/mitcard/idpolicies.html" ,
"<p>%s</p>" ,
"http://web.archive.org/web/20120630032016/http://web.mit.edu/mitcard/idpolicies.html"
] ,
[
"http://www.postgresql.org/message-id/14040.1364490185@sss.pgh.pa.us" ,
"<p>%s</p>" ,
"http://www.postgresql.org/message-id/14040.1364490185@sss.pgh.pa.us"
] ,
[
"javascript:alert(\"hi\");.com" ,
"<p>javascript:alert(\"hi\");.com</p>" ,
""
] ,
[
"javascript:foo.com" ,
"<p>javascript:%s</p>" ,
"foo.com"
] ,
[
"javascript://foo.com" ,
"<p>javascript://foo.com</p>" ,
""
] ,
[
"foobarscript://foo.com" ,
"<p>foobarscript://foo.com</p>" ,
""
] ,
[
"about:blank.com" ,
"<p>about:%s</p>" ,
"blank.com"
] ,
[
"[foo](javascript:foo.com)" ,
"<p>[foo](javascript:%s)</p>" ,
"foo.com"
] ,
[
"[foo](javascript://foo.com)" ,
"<p>[foo](javascript://foo.com)</p>" ,
""
] ,
[
"aim:addbuddy?screenname=foo" ,
"<p>aim:addbuddy?screenname=foo</p>" ,
""
] ,
[
"itms://itunes.com/apps/appname" ,
"<p>itms://itunes.com/apps/appname</p>" ,
""
] ,
[
"[foo](itms://itunes.com/apps/appname)" ,
"<p>[foo](itms://itunes.com/apps/appname)</p>" ,
""
] ,
[
"1 [](foo://) 3 [](foo://) 5" ,
"<p>1 [](foo://) 3 [](foo://) 5</p>" ,
""
] ,
[
"javascript:<i>\"foo&bar\"</i>" ,
"<p>javascript:<i>\"foo&bar\"</i></p>" ,
""
] ,
[
"[foo](javascript:<i>\"foo&bar\"</i>)" ,
"<p>[foo](javascript:<i>\"foo&bar\"</i>)</p>" ,
""
] ,
2020-03-24 03:48:32 +01:00
[
"http://zulip.testserver/#narrow/stream/1-Denmark" ,
2020-05-09 03:44:56 +02:00
"<p><a href=\"#narrow/stream/1-Denmark\">http://zulip.testserver/#narrow/stream/1-Denmark</a></p>" ,
2020-03-24 03:48:32 +01:00
""
] ,
[
"http://zulip.testserver/https://example.com" ,
"<p>%s</p>" ,
"http://zulip.testserver/https://example.com"
] ,
2014-01-17 21:08:45 +01:00
[
"a@b.com" ,
"<p>%s</p>" ,
"a@b.com"
] ,
[
"<a@b.com>" ,
"<p><%s></p>" ,
"a@b.com"
] ,
[
"a@b.com/foo" ,
"<p>a@b.com/foo</p>" ,
""
] ,
[
"http://leo@foo.com/my/file" ,
"<p>%s</p>" ,
"http://leo@foo.com/my/file"
] ,
[
"http://example.com/something?with,commas,in,url, but not at end" ,
"<p>%s, but not at end</p>" ,
"http://example.com/something?with,commas,in,url"
] ,
[
"http://www.yelp.com/biz/taim-mobile-falafel-and-smoothie-truck-new-york#query" ,
"<p>%s</p>" ,
"http://www.yelp.com/biz/taim-mobile-falafel-and-smoothie-truck-new-york#query"
] ,
[
" some text https://www.google.com/baz_(match)?with=foo&bar=baz with extras" ,
"<p>some text %s with extras</p>" ,
"https://www.google.com/baz_(match)?with=foo&bar=baz"
] ,
[
"hash it http://foo.com/blah_(wikipedia)_blah#cite-1" ,
"<p>hash it %s</p>" ,
"http://foo.com/blah_(wikipedia)_blah#cite-1"
] ,
[
"https://metacpan.org/module/Image::Resize::OpenCV" ,
"<p>%s</p>" ,
"https://metacpan.org/module/Image::Resize::OpenCV"
] ,
[
"foo.com/a::trollface::b" ,
"<p>%s</p>" ,
"foo.com/a::trollface::b"
] ,
[
"a.commandstuff()" ,
"<p>a.commandstuff()</p>" ,
""
] ,
[
"love...it" ,
"<p>love...it</p>" ,
""
] ,
[
"sorry,http://example.com/" ,
"<p>sorry,%s</p>" ,
"http://example.com/"
2014-02-06 23:07:24 +01:00
] ,
[
"two nested parens https://zulip.com/(we_like_(to_nest_)_nest)_nest" ,
"<p>two nested parens %s</p>" ,
"https://zulip.com/(we_like_(to_nest_)_nest)_nest"
] ,
[
"three nested parens https://zulip.com/(we_like_(to_(and_)nest_)_nest)_nest" ,
"<p>three nested parens %s</p>" ,
"https://zulip.com/(we_like_(to_(and_)nest_)_nest)_nest"
] ,
[
"four nested parens https://zulip.com/(we_like_(to_n(e)st_)_n(es)t)_nest" ,
"<p>four nested parens %s</p>" ,
"https://zulip.com/(we_like_(to_n(e)st_)_n(es)t)_nest"
] ,
[
"six nested parens https://zulip.com/(we_like_((t(d(o(___)o)o))o_nest_)_nest)_nest" ,
"<p>six nested parens %s</p>" ,
"https://zulip.com/(we_like_((t(d(o(___)o)o))o_nest_)_nest)_nest"
] ,
[
"eight is too many https://zulip.com/(we_like_((t(d(o(_(1(2)1)__)o)o))o_nest_)_nest)_nest" ,
"<p>eight is too many https://zulip.com/(we_like_((t(d(o(_(1(2)1)__)o)o))o_nest_)_nest)_nest</p>" ,
""
] ,
[
"nested with autodetection zulip.us/(we_like_(to_n(e)st_)_n(es)t)_nest" ,
"<p>nested with autodetection %s</p>" ,
"zulip.us/(we_like_(to_n(e)st_)_n(es)t)_nest"
] ,
[
"quora http://generate.quora.net/render?width=700&from=-4hours&until=now&height=400&bgcolor=black&lineMode=connected&title=arb%20hint%20status&target=alias(ans.hintland.hand.arb.enhint_rate%2C%22enhint%20rate%22)&target=alias(ans.hintland.hand.arb.unhint_rate%2C%22unhint%20rate%22)&target=alias(ans.hintland.hand.arb.size%2C%22hint%20size%22)&target=alias(scale(ans.vagabond.dingarb_cube_count%2C10000)%2C%22cube%20count%20x%2010K%22)&target=alias(scale(hnumbers.time.ding.gegevens.query.count%2C10)%2C%22ding%20gegevens%20query%20count%20x%2010%22)&fgcolor=white&uniq=0.44046106841415167" ,
"<p>quora %s</p>" ,
"http://generate.quora.net/render?width=700&from=-4hours&until=now&height=400&bgcolor=black&lineMode=connected&title=arb%20hint%20status&target=alias(ans.hintland.hand.arb.enhint_rate%2C%22enhint%20rate%22)&target=alias(ans.hintland.hand.arb.unhint_rate%2C%22unhint%20rate%22)&target=alias(ans.hintland.hand.arb.size%2C%22hint%20size%22)&target=alias(scale(ans.vagabond.dingarb_cube_count%2C10000)%2C%22cube%20count%20x%2010K%22)&target=alias(scale(hnumbers.time.ding.gegevens.query.count%2C10)%2C%22ding%20gegevens%20query%20count%20x%2010%22)&fgcolor=white&uniq=0.44046106841415167"
2014-01-17 21:08:45 +01:00
]
]
2014-03-06 00:05:49 +01:00
}