2014-01-17 21:08:45 +01:00
{
"regular_tests" : [
{
"name" : "codeblock_hilite" ,
2014-03-06 00:05:49 +01:00
"input" : "Hamlet said:\n~~~~.python \ndef speak(self):\n x = 1\n~~~~" ,
2016-09-12 20:50:10 +02:00
"expected_output" : "<p>Hamlet said:</p>\n<div class=\"codehilite\"><pre><span></span><span class=\"k\">def</span> <span class=\"nf\">speak</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n <span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n</pre></div>" ,
2014-01-17 21:08:45 +01:00
"bugdown_matches_marked" : false
} ,
{
"name" : "basic_paragraph" ,
"input" : "test_input" ,
"expected_output" : "<p>test_input</p>" ,
"bugdown_matches_marked" : true
} ,
{
"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." ,
2016-09-12 20:50:10 +02:00
"expected_output" : "<p>Hamlet once said</p>\n<div class=\"codehilite\"><pre><span></span>def func():\n x = 1\n\n y = 2\n\n z = 3\n</pre></div>\n\n\n<p>And all was good.</p>" ,
2014-01-21 20:46:43 +01:00
"bugdown_matches_marked" : true
2014-01-17 21:08:45 +01:00
} ,
{
"name" : "codeblock_backticks" ,
"input" : "\n```\nfenced code\n```\n\n```inline code```\n" ,
2016-09-12 20:50:10 +02:00
"expected_output" : "<div class=\"codehilite\"><pre><span></span>fenced code\n</pre></div>\n\n\n<p><code>inline code</code></p>" ,
2014-01-21 20:46:43 +01:00
"bugdown_matches_marked" : true
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()" ,
2016-09-12 20:50:10 +02:00
"expected_output" : "<p>Hamlet said:</p>\n<div class=\"codehilite\"><pre><span></span>def speak(self):\n x = 1\n# Comment to make this code block longer to test Trac #1162\n</pre></div>\n\n\n<p>Then he mentioned <code>y = 4 + x**2</code> and</p>\n<div class=\"codehilite\"><pre><span></span>def foobar(self):\n return self.baz()\n</pre></div>" ,
2014-01-27 23:21:48 +01:00
"bugdown_matches_marked" : true
2014-01-17 21:08:45 +01:00
} ,
{
"name" : "fenced_quote" ,
"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>" ,
2014-01-27 23:21:48 +01:00
"bugdown_matches_marked" : true
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>" ,
2014-01-27 23:21:48 +01:00
"bugdown_matches_marked" : true
2014-01-17 21:08:45 +01:00
} ,
{
"name" : "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~~~" ,
2016-09-12 20:50:10 +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>def hello(): print 'hello\n</pre></div>\n\n\n<p>They would prefer:</p>\n</blockquote>\n<p>def hello()<br>\n puts 'hello'<br>\nend</p>\n</blockquote>\n<p>Please advise.</p>\n<div class=\"codehilite\"><pre><span></span>She said:\n~~~ quote\nJust send them this:\n```\necho "hello\n"\n```\n</pre></div>" ,
2014-01-17 21:08:45 +01:00
"bugdown_matches_marked" : false
} ,
{
"name" : "dangerous_block" ,
"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>" ,
"bugdown_matches_marked" : false
} ,
{
"name" : "dangerous_block" ,
"input" : "``` one ```\n\n``` two ```\n\n~~~~\nx = 1" ,
2016-09-12 20:50:10 +02:00
"expected_output" : "<p><code>one</code></p>\n<p><code>two</code></p>\n<div class=\"codehilite\"><pre><span></span>x = 1\n</pre></div>" ,
2014-01-27 23:21:48 +01:00
"bugdown_matches_marked" : true
2014-01-17 21:08:45 +01:00
} ,
{
"name" : "ulist_standard" ,
"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>" ,
"bugdown_matches_marked" : true
} ,
{
"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>" ,
"bugdown_matches_marked" : true
} ,
{
"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>" ,
"bugdown_matches_marked" : false
} ,
{
"name" : "ulist_hanging_multi" ,
"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>" ,
"bugdown_matches_marked" : true
} ,
{
"name" : "ulist_codeblock" ,
"input" : "~~~\nint x = 3\n* 4;\n~~~" ,
2016-09-12 20:50:10 +02:00
"expected_output" : "<div class=\"codehilite\"><pre><span></span>int x = 3\n* 4;\n</pre></div>" ,
2014-01-17 21:08:45 +01:00
"bugdown_matches_marked" : true
} ,
{
"name" : "malformed_fence" ,
"input" : "~~~~~~~~xxxxxxxxx: xxxxxxxxxxxx xxxxx x xxxxxxxx~~~~~~" ,
"expected_output" : "<p>~~~~~~~~xxxxxxxxx: xxxxxxxxxxxx xxxxx x xxxxxxxx~~~~~~</p>" ,
"bugdown_matches_marked" : true
} ,
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>" ,
"bugdown_matches_marked" : true
} ,
{
"name" : "strikthrough_multiword" ,
"input" : "I ~~like software~~ love hardware" ,
"expected_output" : "<p>I <del>like software</del> love hardware</p>" ,
"bugdown_matches_marked" : true
} ,
{
"name" : "strikthrough_multiword" ,
"input" : "I ~~ like software ~~ love hardware" ,
"expected_output" : "<p>I <del> like software </del> love hardware</p>" ,
"bugdown_matches_marked" : true
} ,
2014-01-17 21:08:45 +01:00
{
"name" : "underscore_disabled" ,
"input" : "_foo_" ,
"expected_output" : "<p>_foo_</p>" ,
"bugdown_matches_marked" : true
} ,
{
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>" ,
"bugdown_matches_marked" : true
} ,
{
"name" : "emphasis_code" ,
"input" : "const char *x = (char *)y" ,
"expected_output" : "<p>const char *x = (char *)y</p>" ,
"bugdown_matches_marked" : true
} ,
{
"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>" ,
2014-01-17 21:08:45 +01:00
"bugdown_matches_marked" : true
} ,
{
"name" : "underscore_strong_disabled" ,
"input" : "__foo__" ,
"expected_output" : "<p>__foo__</p>" ,
"bugdown_matches_marked" : true
} ,
{
"name" : "star_strong" ,
"input" : "**foo**" ,
"expected_output" : "<p><strong>foo</strong></p>" ,
"bugdown_matches_marked" : true
} ,
{
"name" : "linkify_interference" ,
"input" : "link: xx, x xxxxx xx xxxx xx\n\n[xxxxx #xx](http://xxxxxxxxx:xxxx/xxx/xxxxxx%xxxxxx/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%xxxxxx/xx/\" target=\"_blank\" title=\"http://xxxxxxxxx:xxxx/xxx/xxxxxx%xxxxxx/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>" ,
"bugdown_matches_marked" : true
} ,
{
"name" : "inline_image" ,
"input" : "Google logo today: https://www.google.com/images/srpr/logo4w.png\nKinda boring" ,
"expected_output" : "<p>Google logo today: <a href=\"https://www.google.com/images/srpr/logo4w.png\" target=\"_blank\" title=\"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\" target=\"_blank\" title=\"https://www.google.com/images/srpr/logo4w.png\"><img src=\"https://www.google.com/images/srpr/logo4w.png\"></a></div>" ,
"bugdown_matches_marked" : false
} ,
{
"name" : "two_inline_images" ,
"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" ,
"expected_output" : "<p>Google logo today: <a href=\"https://www.google.com/images/srpr/logo4w.png\" target=\"_blank\" title=\"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\" target=\"_blank\" title=\"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\" target=\"_blank\" title=\"https://www.google.com/images/srpr/logo4w.png\"><img src=\"https://www.google.com/images/srpr/logo4w.png\"></a></div><div class=\"message_inline_image\"><a href=\"https://www.google.com/images/srpr/logo4w.png\" target=\"_blank\" title=\"https://www.google.com/images/srpr/logo4w.png\"><img src=\"https://www.google.com/images/srpr/logo4w.png\"></a></div>" ,
"bugdown_matches_marked" : false
} ,
{
"name" : "camo" ,
"input" : "Google logo today: http://www.google.com/images/srpr/logo4w.png" ,
2015-06-10 20:27:50 +02:00
"expected_output" : "<p>Google logo today: <a href=\"http://www.google.com/images/srpr/logo4w.png\" target=\"_blank\" title=\"http://www.google.com/images/srpr/logo4w.png\">http://www.google.com/images/srpr/logo4w.png</a></p>\n<div class=\"message_inline_image\"><a href=\"http://www.google.com/images/srpr/logo4w.png\" target=\"_blank\" title=\"http://www.google.com/images/srpr/logo4w.png\"><img src=\"https://external-content.zulipcdn.net/7b6552b60c635e41e8f6daeb36d88afc4eabde79/687474703a2f2f7777772e676f6f676c652e636f6d2f696d616765732f737270722f6c6f676f34772e706e67\"></a></div>" ,
2014-01-17 21:08:45 +01:00
"bugdown_matches_marked" : false
} ,
{
"name" : "nl2br" ,
"input" : "test\nbar" ,
"expected_output" : "<p>test<br>\nbar</p>" ,
"bugdown_matches_marked" : true
} ,
{
"name" : "nl2br_trailing_space" ,
"input" : "test " ,
"expected_output" : "<p>test </p>" ,
"bugdown_matches_marked" : true
} ,
{
"name" : "tables" ,
"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>" ,
"bugdown_matches_marked" : true
} ,
{
"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>" ,
"bugdown_matches_marked" : false
2014-01-24 22:52:37 +01:00
} ,
{
"name" : "many_emoji" ,
"input" : "test :smile: again :poop:\n:) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:" ,
2016-06-13 08:18:33 +02:00
"expected_output" : "<p>test <img alt=\":smile:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/smile.png\" title=\":smile:\"> again <img alt=\":poop:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/poop.png\" title=\":poop:\"><br>\n:) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:</p>" ,
2014-01-24 22:52:37 +01:00
"bugdown_matches_marked" : true
} ,
{
"name" : "random_emoji_1" ,
"input" : ":hankey:" ,
2016-06-13 08:18:33 +02:00
"expected_output" : "<p><img alt=\":hankey:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/hankey.png\" title=\":hankey:\"></p>" ,
2014-01-24 22:52:37 +01:00
"bugdown_matches_marked" : true
} ,
{
"name" : "random_emoji_2" ,
"input" : ":poop:" ,
2016-06-13 08:18:33 +02:00
"expected_output" : "<p><img alt=\":poop:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/poop.png\" title=\":poop:\"></p>" ,
2014-01-24 22:52:37 +01:00
"bugdown_matches_marked" : true
} ,
2016-11-08 12:20:56 +01:00
{
"name" : "emojis_without_space" ,
"input" : ":cat:hello:dog::rabbit:" ,
"expected_output" : "<p><img alt=\":cat:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/cat.png\" title=\":cat:\">hello<img alt=\":dog:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/dog.png\" title=\":dog:\"><img alt=\":rabbit:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/rabbit.png\" title=\":rabbit:\"></p>" ,
"bugdown_matches_marked" : true
} ,
{
"name" : "emojis_newline" ,
"input" : ":cat:\n:dog:" ,
"expected_output" : "<p><img alt=\":cat:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/cat.png\" title=\":cat:\"><br>\n<img alt=\":dog:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/dog.png\" title=\":dog:\"></p>" ,
"bugdown_matches_marked" : true
} ,
2014-01-24 22:52:37 +01:00
{
"name" : "not_emoji" ,
"input" : ":not_an_emoji:" ,
"expected_output" : "<p>:not_an_emoji:</p>" ,
"bugdown_matches_marked" : true
} ,
2016-06-24 22:39:44 +02:00
{
"name" : "unicode_emoji" ,
"input" : "\ud83d\udca9" ,
"expected_output" : "<p><img alt=\"\ud83d\udca9\" class=\"emoji\" src=\"\/static\/third\/gemoji\/images\/emoji\/unicode\/1f4a9.png\" title=\"\ud83d\udca9\"><\/p>" ,
"bugdown_matches_marked" : true
} ,
{
"name" : "two_unicode_emoji" ,
"input" : "\ud83d\udca9\ud83d\udca9" ,
"expected_output" : "<p><img alt=\"\ud83d\udca9\" class=\"emoji\" src=\"\/static\/third\/gemoji\/images\/emoji\/unicode\/1f4a9.png\" title=\"\ud83d\udca9\"><img alt=\"\ud83d\udca9\" class=\"emoji\" src=\"\/static\/third\/gemoji\/images\/emoji\/unicode\/1f4a9.png\" title=\"\ud83d\udca9\"><\/p>" ,
"bugdown_matches_marked" : true
} ,
{
"name" : "two_unicode_emoji_separated_by_text" ,
"input" : "\ud83d\udca9 word \ud83d\udca9" ,
"expected_output" : "<p><img alt=\"\ud83d\udca9\" class=\"emoji\" src=\"\/static\/third\/gemoji\/images\/emoji\/unicode\/1f4a9.png\" title=\"\ud83d\udca9\"> word <img alt=\"\ud83d\udca9\" class=\"emoji\" src=\"\/static\/third\/gemoji\/images\/emoji\/unicode\/1f4a9.png\" title=\"\ud83d\udca9\"><\/p>" ,
"bugdown_matches_marked" : true
} ,
2014-01-24 22:52:37 +01:00
{
"name" : "emoji_alongside_punctuation" ,
"input" : ":smile:, :smile:; :smile:" ,
2016-06-13 08:18:33 +02:00
"expected_output" : "<p><img alt=\":smile:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/smile.png\" title=\":smile:\">, <img alt=\":smile:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/smile.png\" title=\":smile:\">; <img alt=\":smile:\" class=\"emoji\" src=\"/static/third/gemoji/images/emoji/smile.png\" title=\":smile:\"></p>" ,
2014-01-24 22:52:37 +01:00
"bugdown_matches_marked" : true
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>" ,
"bugdown_matches_marked" : true
} ,
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>" ,
"bugdown_matches_marked" : false
} ,
{
"name" : "safe_html_nested_script_tag" ,
"input" : "<<script>script>evil()<</script>/script>" ,
"expected_output" : "<p><<script>script>evil()<</script>/script></p>" ,
"bugdown_matches_marked" : true
} ,
{
"name" : "safe_html_nested_script_tag_with_parse_error" ,
"input" : "<<x>script>evil()<</x>/script>" ,
"expected_output" : "<p><<x>script>evil()<</x>/script></p>" ,
"bugdown_matches_marked" : true
} ,
{
"name" : "safe_html_messed_up_complexly_nested_script_tags" ,
"input" : "<scr<script></script>ipt type=\"text/javascript\">alert(\"foo\");</<script></script>script<del></del>>" ,
"expected_output" : "<p><scr<script></script>ipt type=\"text/javascript\">alert(\"foo\");</<script></script>script<del></del>></p>" ,
"bugdown_matches_marked" : false
} ,
{
"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>" ,
"bugdown_matches_marked" : false
} ,
{
"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>" ,
"bugdown_matches_marked" : false
} ,
2014-02-03 17:13:40 +01:00
{
"name" : "safe_html_in_code" ,
"input" : "~~~\n<h1>stay normal</h1>" ,
2016-09-12 20:50:10 +02:00
"expected_output" : "<div class=\"codehilite\"><pre><span></span><h1>stay normal</h1>\n</pre></div>" ,
2014-02-03 17:13:40 +01:00
"bugdown_matches_marked" : true
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>" ,
"bugdown_matches_marked" : true
2016-08-17 03:09:32 +02:00
} ,
{
"name" : "modal_link" ,
"input" : "!modal_link(#settings, Settings page)" ,
"expected_output" : "<p><a data-toggle=\"modal\" href=\"#settings\" title=\"#settings\">Settings page</a></p>" ,
"bugdown_matches_marked" : false
} ,
{
"name" : "modal_link_escaped" ,
"input" : "`!modal_link(#settings, Settings page)`" ,
"expected_output" : "<p><code>!modal_link(#settings, Settings page)</code></p>" ,
"bugdown_matches_marked" : true
} ,
2016-08-18 23:48:02 +02:00
{
"name" : "avatar" ,
"input" : "!avatar(username@example.com)" ,
"expected_output" : "<p><img alt=\"username@example.com\" class=\"message_body_gravatar\" src=\"/avatar/username@example.com?s=30\" title=\"username@example.com\"></p>" ,
2016-10-19 16:49:53 +02:00
"bugdown_matches_marked" : true
2016-08-18 23:48:02 +02:00
} ,
{
"name" : "gravatar" ,
"input" : "!gravatar(username@example.com)" ,
"expected_output" : "<p><img alt=\"username@example.com\" class=\"message_body_gravatar\" src=\"/avatar/username@example.com?s=30\" title=\"username@example.com\"></p>" ,
2016-10-20 21:42:55 +02:00
"bugdown_matches_marked" : true
2016-08-18 23:48:02 +02:00
} ,
2016-08-17 03:09:32 +02:00
{
"name" : "avatar_escaped" ,
"input" : "`!avatar(username@example.com)`" ,
"expected_output" : "<p><code>!avatar(username@example.com)</code></p>" ,
"bugdown_matches_marked" : true
} ,
{
"name" : "gravatar_escaped" ,
"input" : "`!gravatar(username@example.com)`" ,
"expected_output" : "<p><code>!gravatar(username@example.com)</code></p>" ,
"bugdown_matches_marked" : true
} ,
{
"name" : "stream_subscribe_button" ,
"input" : "!_stream_subscribe_button(streamname)" ,
"expected_output" : "<p><span class=\"inline-subscribe\" data-stream-name=\"streamname\"><button class=\"inline-subscribe-button btn\">Subscribe to streamname</button><span class=\"inline-subscribe-error\"></span></span></p>" ,
"bugdown_matches_marked" : false
} ,
{
"name" : "stream_subscribe_button_escaped" ,
"input" : "`!_stream_subscribe_button(streamname)`" ,
"expected_output" : "<p><code>!_stream_subscribe_button(streamname)</code></p>" ,
"bugdown_matches_marked" : true
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"
] ,
[
"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://en.wikipedia.org/wiki/File:Methamphetamine_from_ephedrine_with_HI_en.mov" ,
"<p>%s</p>" ,
"https://en.wikipedia.org/wiki/File:Methamphetamine_from_ephedrine_with_HI_en.mov"
] ,
[
"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>" ,
""
] ,
[
"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"
] ,
[
"http://technet.microsoft.com/en-us/library/Cc751099.rk20_25_big(l=en-us).mov" ,
"<p>%s</p>" ,
"http://technet.microsoft.com/en-us/library/Cc751099.rk20_25_big(l=en-us).mov"
] ,
[
"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
}