<\/a><\/div>",
"backend_only_rendering": true,
"text_content": "Google logo today: https:\/\/www.google.com\/images\/srpr\/logo4w.png\nKinda boring\nZulip logo: https:\/\/zulip.com\/static\/images\/landing-page\/zulip-octopus.png\n"
},
{
"name": "deduplicate_inline_previews",
"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": "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",
"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"
},
{
"name": "bulleted_list_inlining",
"input": "* Google?\n* Google. https://www.google.com/images/srpr/logo4w.png\n* Google!",
"expected_output": "",
"backend_only_rendering": true,
"text_content": "\nGoogle?\nGoogle. https://www.google.com/images/srpr/logo4w.png\nGoogle!\n"
},
{
"name": "only_inline_image",
"input": "https://www.google.com/images/srpr/logo4w.png",
"expected_output": "",
"backend_only_rendering": true
},
{
"name": "only_named_inline_image",
"input": "[Google Link](https://www.google.com/images/srpr/logo4w.png)",
"expected_output": "Google Link
\n",
"backend_only_rendering": true,
"text_content": "Google Link\n"
},
{
"name": "only_non_image_link",
"input": "https://github.com",
"expected_output": "https://github.com
"
},
{
"name": "link_with_text",
"input": "[hello](https://github.com)",
"expected_output": "hello
"
},
{
"name": "link_without_text",
"input": "[](https://github.com)",
"expected_output": "https://github.com
"
},
{
"name": "link_with_empty_text",
"input": "[ ](https://github.com)",
"expected_output": "https://github.com
"
},
{
"name": "fragment_link",
"input": "[foo](http://zulip.testserver/#narrow/stream/1-Denmark)",
"expected_output": "foo
",
"marked_expected_output": "foo
"
},
{
"name": "not_fragment_link",
"input": "[foo](http://zulip.testserver/https://example.com)",
"expected_output": "foo
"
},
{
"name": "nl2br",
"input": "test\nbar",
"expected_output": "test
\nbar
",
"text_content": "test\nbar"
},
{
"name": "nl2br_trailing_space",
"input": "test ",
"expected_output": "test
",
"text_content": "test "
},
{
"name": "tables",
"input": "This is a table:\n\nFirst Header | Second Header\n------------- | -------------\nContent Cell | Content Cell\nContent Cell | Content Cell\n",
"expected_output": "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
",
"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"
},
{
"name": "multiline_strong",
"input": "You can check out **any time you'd like\nBut you can never leave**",
"expected_output": "
You can check out **any time you'd like
\nBut you can never leave**
",
"marked_expected_output": "
You can check out any time you'd like
\nBut you can never leave
",
"text_content": "You can check out **any time you'd like\nBut you can never leave**"
},
{
"name": "many_emoji",
"input": "test :smile: again :poop:\n:) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:",
"expected_output": "
test :smile: again :poop:
\n:) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:
",
"text_content": "test \u263A again \ud83d\udca9\n:) foo:)bar x::y::z :wasted waste: :fakeemojithisshouldnotrender:"
},
{
"name": "translate_emoticons_not_enabled",
"input": ":)",
"expected_output": "
:)
",
"text_content": ":)",
"translate_emoticons": false
},
{
"name": "translate_emoticons_enabled",
"input": ":)",
"expected_output": "
:slight_smile:
",
"text_content": "\ud83d\ude42",
"translate_emoticons": true
},
{
"name": "translate_emoticons",
"input": ":) foo :( bar <3 with space : ) real emoji :slight_smile:",
"expected_output": "
:slight_smile: foo :frown: bar :heart: with space : ) real emoji :slight_smile:
",
"text_content": "\ud83d\ude42 foo \ud83d\ude41 bar \u2764 with space : ) real emoji \ud83d\ude42",
"translate_emoticons": true
},
{
"name": "translate_emoticons_whitepsace",
"input": "a:) ;)b",
"expected_output": "
a:) ;)b
",
"text_content": "a:) ;)b",
"translate_emoticons": true
},
{
"name": "translate_emoticons_newline",
"input": ":) test\n:) test",
"expected_output": "
:slight_smile: test
\n:slight_smile: test
",
"text_content": "\ud83d\ude42 test\n\ud83d\ude42 test",
"translate_emoticons": true
},
{
"name": "translate_emoticons_in_code",
"input": "`:)`",
"expected_output": "
:)
",
"text_content": ":)",
"translate_emoticons": true
},
{
"name": "translate_emoticons_at_sentence_end",
"input": "Translate this :).",
"expected_output": "
Translate this :slight_smile:.
",
"text_content": "Translate this \ud83d\ude42.",
"translate_emoticons": true
},
{
"name": "translate_emoticons_between_symbols",
"input": "Translate this !:)?",
"expected_output": "
Translate this !:slight_smile:?
",
"marked_expected_output": "
Translate this !:)?
",
"text_content": "Translate this !\ud83d\ude42?",
"translate_emoticons": true
},
{
"name": "random_emoji_1",
"input": ":airplane:",
"expected_output": "
:airplane:
"
},
{
"name": "zulip_emoji",
"input": ":zulip:",
"expected_output": "
",
"text_content": ":zulip:"
},
{
"name": "random_emoji_2",
"input": ":poop:",
"expected_output": "
:poop:
"
},
{
"name": "emojis_without_space",
"input": ":cat:hello:dog::rabbit:",
"expected_output": "
:cat:hello:dog::rabbit:
",
"text_content": "\ud83d\udc08hello\ud83d\udc15\ud83d\udc07"
},
{
"name": "emojis_newline",
"input": ":cat:\n:dog:",
"expected_output": "
:cat:
\n:dog:
",
"text_content": "\ud83d\udc08\n\ud83d\udc15"
},
{
"name": "not_emoji",
"input": ":not_an_emoji:",
"expected_output": "
:not_an_emoji:
",
"text_content": ":not_an_emoji:"
},
{
"name": "unicode_emoji",
"input": "\ud83d\udca9",
"expected_output":"
:poop:
",
"text_content": "\ud83d\udca9"
},
{
"name": "two_unicode_emoji",
"input": "\ud83d\udca9\ud83d\udca9",
"expected_output":"
:poop::poop:<\/p>",
"text_content": "\ud83d\udca9\ud83d\udca9"
},
{
"name": "two_unicode_emoji_separated_by_text",
"input": "\ud83d\udca9 word \ud83d\udca9",
"expected_output":"
:poop: word :poop:<\/p>",
"text_content": "\ud83d\udca9 word \ud83d\udca9"
},
{
"name": "miscellaneous_symbols_and_pictographs",
"input": "Merry Christmas!!\ud83c\udf84",
"expected_output":"
Merry Christmas!!:holiday_tree:<\/p>",
"text_content": "Merry Christmas!!\ud83c\udf84"
},
{
"name": "miscellaneous_and_dingbats_emoji",
"input": "\u2693\u2797",
"expected_output":"
:anchor::division:<\/p>"
},
{
"name": "supplemental_symbols_and_pictographs",
"input": "I am a robot \ud83e\udd16.",
"expected_output":"
I am a robot :robot:.<\/p>"
},
{
"name": "miscellaneous_symbols_and_arrows",
"input": "Black upward arrow \u2b06",
"expected_output":"
Black upward arrow :up:<\/p>"
},
{
"name": "unicode_emoji_without_space",
"input": "Extra\ud83d\udc7dTerrestrial",
"expected_output":"
Extra:alien:Terrestrial<\/p>"
},
{
"name": "unicode_emojis_new_line",
"input": "\ud83d\udc7d\n\ud83d\udc7d",
"expected_output":"
:alien:
\n:alien:
",
"text_content": "\ud83d\udc7d\n\ud83d\udc7d"
},
{
"name": "emoji_alongside_punctuation",
"input": ":smile:, :smile:; :smile:",
"expected_output": "
:smile:, :smile:; :smile:
"
},
{
"name": "new_emoji_test",
"input": ":avocado:, :kiwi:, :selfie:, :gear:, :comet:, :gold:",
"expected_output": "
:avocado:, :kiwi:, :selfie:, :gear:, :comet:, :gold:
"
},
{
"name": "emoji_pipeline_newline",
"input": "The winner is:\nsmiley:smiley:",
"expected_output": "
The winner is:
\nsmiley:smiley:
"
},
{
"name": "emoji_pipeline_emphasis",
"input": "Testing *:smiley*: :sm*iley*: Testing",
"expected_output": "
Testing :smiley: :smiley: Testing
"
},
{
"name": "emoji_pipeline_link",
"input": "Visit https:smiley://google.com.",
"expected_output": "
Visit https:smiley://google.com.
"
},
{
"name": "skin_tones_are_banned",
"input": ":skin-tone-2: :skin-tone-3:",
"expected_output": "
:skin-tone-2: :skin-tone-3:
"
},
{
"name": "fried_egg",
"input": "new :fried_egg: emoji is banned for now.",
"expected_output": "
new :fried_egg: emoji is banned for now.
"
},
{
"name": "emojis_with_zwj_are_banned",
"input": "Emojis like :man-girl-girl: which have ZWJ are banned for now.",
"expected_output": "
Emojis like :man-girl-girl: which have ZWJ are banned for now.
",
"text_content": "Emojis like :man-girl-girl: which have ZWJ are banned for now."
},
{
"name": "valid_emoji_preceded_by_invalid_emoji",
"input": "This is :invalidemoji: which should not prevent rendering :smile:",
"expected_output": "
This is :invalidemoji: which should not prevent rendering :smile:
"
},
{
"name": "safe_html",
"input": "
stay normal
thanks",
"expected_output": "
<h1>stay normal</h1> thanks
",
"text_content": "
stay normal<\/h1> thanks"
},
{
"name": "safe_html_with_simple_script_tag",
"input": "",
"expected_output": "
<script>alert(1)</script>
",
"marked_expected_output": "
<script>alert(1)</script>\n\n
",
"text_content": "/script>",
"expected_output": "
<<script>script>evil()<</script>/script>
",
"text_content": "<ipt type=\"text/javascript\">alert(\"foo\");script
>",
"expected_output": "
<scr<script></script>ipt type=\"text/javascript\">alert(\"foo\");</<script></script>script<del></del>>
"
},
{
"name": "safe_html_unclosed_tag",
"input": "$$\n\n~~~math\n\n~~~",
"expected_output": "
<scripttype=′text/javascript′>alert(′xss′);</script>
\n
<scripttype=′text/javascript′>alert(′xss′);</script>
",
"marked_expected_output": "
<scripttype=′text/javascript′>alert(′xss′);</script>
\n
<scripttype=′text/javascript′>alert(′xss′);</script>"
},
{
"name": "tex_error_safe_script_tag",
"input": "$$\\$$\n\n~~~math\n\\\n~~~",
"expected_output": "
$$\\<script type='text/javascript'>alert('xss');</script>$$
\n
\\<script type='text/javascript'>alert('xss');</script>
",
"marked_expected_output": "
$$\\<script type='text/javascript'>alert('xss');</script>$$
\n
\\<script type='text/javascript'>alert('xss');</script>"
},
{
"name": "auto_renumbered_list_blankline",
"input": "1. A\n\n1. B\n\n1. C\n\n1. D\nordinary paragraph\n1. AA\n\n1. BB",
"expected_output": "
\n- \n
A
\n \n- \n
B
\n \n- \n
C
\n \n- \n
D
\nordinary paragraph
\n \n- \n
AA
\n \n- \n
BB
\n \n
",
"marked_expected_output": "
\nA
\n \nB
\n \nC
\n \nD
\nordinary paragraph
\n \nAA
\n \nBB
\n \n
",
"text_content": "1. A\n2. B\n3. C\n4. D\nordinary paragraph\n5. AA\n6. BB"
},
{
"name": "spoilers_fenced_spoiler",
"input": "```spoiler header\ncontent\n```\noutside spoiler\n",
"expected_output": "
\n\n
outside spoiler
"
},
{
"name": "spoilers_empty_header",
"input": "```spoiler\ncontent\n```\noutside spoiler\n",
"expected_output": "
\n\n
outside spoiler
"
},
{
"name": "spoilers_script_tags",
"input": "```spoiler \n\n```",
"expected_output": "
\n\n
<script>alert(1)</script>
\n
",
"marked_expected_output": "
\n\n
<script>alert(1)</script>\n\n
\n
"
},
{
"name": "spoilers_block_quote",
"input": "~~~quote\n```spoiler header\ncontent\n```\noutside spoiler\n~~~\noutside quote",
"expected_output": "
\n\n\noutside spoiler
\n
\n
outside quote
"
},
{
"name": "spoilers_with_header_markdown",
"input": "```spoiler [Header](https://example.com) :smile:\ncontent\n```",
"expected_output": "
"
},
{
"name": "spoiler_with_inline_image",
"input": "```spoiler header\nContent http://example.com/image.png\n```",
"expected_output": "
",
"marked_expected_output": "
"
}
],
"linkify_tests": [
[
"http://www.google.com",
"
%s
",
"http://www.google.com"
],
[
"https://www.google.com",
"
%s
",
"https://www.google.com"
],
[
"http://www.theregister.co.uk/foo/bar",
"
%s
",
"http://www.theregister.co.uk/foo/bar"
],
[
" some text https://www.google.com/",
"
some text %s
",
"https://www.google.com/"
],
[
"with short example.com url",
"
with short %s url
",
"example.com"
],
[
"t.co",
"
%s
",
"t.co"
],
[
"readme.md",
"
readme.md
",
"readme.md"
],
[
"go to views.org please",
"
go to %s please
",
"views.org"
],
[
"http://foo.com/blah_blah/",
"
%s
",
"http://foo.com/blah_blah/"
],
[
"python class views.py is",
"
python class views.py is
",
""
],
[
"with www www.zulip.com/foo ok?",
"
with www %s ok?
",
"www.zulip.com/foo"
],
[
"allow questions like foo.com?",
"
allow questions like %s?
",
"foo.com"
],
[
"\"is.gd/foo/ \"",
"
\"%s \"
",
"is.gd/foo/"
],
[
"end of sentence https://t.co.",
"
end of sentence %s.
",
"https://t.co"
],
[
"(Something like http://foo.com/blah_blah)",
"
(Something like %s)
",
"http://foo.com/blah_blah"
],
[
"\"is.gd/foo/\"",
"
\"%s\"
",
"is.gd/foo/"
],
[
"end with a quote www.google.com\"",
"
end with a quote %s\"
",
"www.google.com"
],
[
"end with an exclamation www.google.com!",
"
end with an exclamation %s!
",
"www.google.com"
],
[
"http://www.guardian.co.uk/foo/bar",
"
%s
",
"http://www.guardian.co.uk/foo/bar"
],
[
"from http://supervisord.org/running.html:",
"
from %s:
",
"http://supervisord.org/running.html"
],
[
"http://raven.io",
"
%s
",
"http://raven.io"
],
[
"at https://zulip.com/api. Check it!",
"
at %s. Check it!
",
"https://zulip.com/api"
],
[
"goo.gl/abc",
"
%s
",
"goo.gl/abc"
],
[
"I spent a year at ucl.ac.uk",
"
I spent a year at %s
",
"ucl.ac.uk"
],
[
"http://a.cc/i/FMXO",
"
%s
",
"http://a.cc/i/FMXO"
],
[
"http://fmota.eu/blog/test.html",
"
%s
",
"http://fmota.eu/blog/test.html"
],
[
"http://j.mp/14Hwm3X",
"
%s
",
"http://j.mp/14Hwm3X"
],
[
"http://localhost:9991/?show_debug=1",
"
%s
",
"http://localhost:9991/?show_debug=1"
],
[
"anyone before? (http://a.cc/i/FMXO)",
"
anyone before? (%s)
",
"http://a.cc/i/FMXO"
],
[
"(http://en.wikipedia.org/wiki/Each-way_(bet))",
"
(%s)
",
"http://en.wikipedia.org/wiki/Each-way_(bet)"
],
[
"(http://en.wikipedia.org/wiki/Each-way_(bet)_(more_parens))",
"
(%s)
",
"http://en.wikipedia.org/wiki/Each-way_(bet)_(more_parens)"
],
[
"http://en.wikipedia.org/wiki/Qt_(framework)",
"
%s
",
"http://en.wikipedia.org/wiki/Qt_(framework)"
],
[
"http://fr.wikipedia.org/wiki/Fichier:SMirC-facepalm.svg",
"
%s
",
"http://fr.wikipedia.org/wiki/Fichier:SMirC-facepalm.svg"
],
[
"https://en.wikipedia.org/wiki/File:Methamphetamine_from_ephedrine_with_HI_en.mov",
"
%s
",
"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",
"
%s
",
"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",
"
%s
",
"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",
"
%s
",
"http://www.postgresql.org/message-id/14040.1364490185@sss.pgh.pa.us"
],
[
"javascript:alert(\"hi\");.com",
"
javascript:alert(\"hi\");.com
",
""
],
[
"javascript:foo.com",
"
javascript:%s
",
"foo.com"
],
[
"javascript://foo.com",
"
javascript://foo.com
",
""
],
[
"foobarscript://foo.com",
"
foobarscript://foo.com
",
""
],
[
"about:blank.com",
"
about:%s
",
"blank.com"
],
[
"[foo](javascript:foo.com)",
"
[foo](javascript:%s)
",
"foo.com"
],
[
"[foo](javascript://foo.com)",
"
[foo](javascript://foo.com)
",
""
],
[
"aim:addbuddy?screenname=foo",
"
aim:addbuddy?screenname=foo
",
""
],
[
"itms://itunes.com/apps/appname",
"
itms://itunes.com/apps/appname
",
""
],
[
"[foo](itms://itunes.com/apps/appname)",
"
[foo](itms://itunes.com/apps/appname)
",
""
],
[
"1 [](foo://) 3 [](foo://) 5",
"
1 [](foo://) 3 [](foo://) 5
",
""
],
[
"javascript:
\"foo&bar\"",
"
javascript:<i>\"foo&bar\"</i>
",
""
],
[
"[foo](javascript:
\"foo&bar\")",
"
[foo](javascript:<i>\"foo&bar\"</i>)
",
""
],
[
"http://zulip.testserver/#narrow/stream/1-Denmark",
"
http://zulip.testserver/#narrow/stream/1-Denmark
",
""
],
[
"http://zulip.testserver/https://example.com",
"
%s
",
"http://zulip.testserver/https://example.com"
],
[
"a@b.com",
"
%s
",
"a@b.com"
],
[
"
",
"<%s>
",
"a@b.com"
],
[
"a@b.com/foo",
"a@b.com/foo
",
""
],
[
"http://leo@foo.com/my/file",
"%s
",
"http://leo@foo.com/my/file"
],
[
"http://example.com/something?with,commas,in,url, but not at end",
"%s, but not at end
",
"http://example.com/something?with,commas,in,url"
],
[
"http://www.yelp.com/biz/taim-mobile-falafel-and-smoothie-truck-new-york#query",
"%s
",
"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",
"some text %s with extras
",
"https://www.google.com/baz_(match)?with=foo&bar=baz"
],
[
"hash it http://foo.com/blah_(wikipedia)_blah#cite-1",
"hash it %s
",
"http://foo.com/blah_(wikipedia)_blah#cite-1"
],
[
"http://technet.microsoft.com/en-us/library/Cc751099.rk20_25_big(l=en-us).mov",
"%s
",
"http://technet.microsoft.com/en-us/library/Cc751099.rk20_25_big(l=en-us).mov"
],
[
"https://metacpan.org/module/Image::Resize::OpenCV",
"%s
",
"https://metacpan.org/module/Image::Resize::OpenCV"
],
[
"foo.com/a::trollface::b",
"%s
",
"foo.com/a::trollface::b"
],
[
"a.commandstuff()",
"a.commandstuff()
",
""
],
[
"love...it",
"love...it
",
""
],
[
"sorry,http://example.com/",
"sorry,%s
",
"http://example.com/"
],
[
"two nested parens https://zulip.com/(we_like_(to_nest_)_nest)_nest",
"two nested parens %s
",
"https://zulip.com/(we_like_(to_nest_)_nest)_nest"
],
[
"three nested parens https://zulip.com/(we_like_(to_(and_)nest_)_nest)_nest",
"three nested parens %s
",
"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",
"four nested parens %s
",
"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",
"six nested parens %s
",
"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",
"eight is too many https://zulip.com/(we_like_((t(d(o(_(1(2)1)__)o)o))o_nest_)_nest)_nest
",
""
],
[
"nested with autodetection zulip.us/(we_like_(to_n(e)st_)_n(es)t)_nest",
"nested with autodetection %s
",
"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",
"quora %s
",
"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"
]
]
}