Warning, /education/cantor/thirdparty/discount-2.2.6-patched/tests/schiraldi.t is written in an unsupported language. File is not indexed.

0001 . tests/functions.sh
0002 
0003 title "Bugs & misfeatures reported by Mike Schiraldi"
0004 
0005 rc=0
0006 MARKDOWN_FLAGS=
0007 
0008 try -fnohtml 'breaks with -fnohtml' 'foo  
0009 bar' '<p>foo<br/>
0010 bar</p>'
0011 
0012 try 'links with trailing \)' \
0013     '[foo](http://en.wikipedia.org/wiki/Link_(film\))' \
0014     '<p><a href="http://en.wikipedia.org/wiki/Link_(film)">foo</a></p>'
0015 
0016 try -fautolink '(url) with -fautolink' \
0017     '(http://tsfr.org)' \
0018     '<p>(<a href="http://tsfr.org">http://tsfr.org</a>)</p>'
0019 
0020 try 'single #' \
0021     '#' \
0022     '<p>#</p>'
0023 
0024 try -frelax '* processing with -frelax' \
0025     '2*4 = 8 * 1 = 2**3' \
0026     '<p>2*4 = 8 * 1 = 2**3</p>'
0027 
0028 try -fnopants '[]() with a single quote mark' \
0029     '[Poe'"'"'s law](http://rationalwiki.com/wiki/Poe'"'"'s_Law)' \
0030     '<p><a href="http://rationalwiki.com/wiki/Poe'"'"'s_Law">Poe'"'"'s law</a></p>'
0031 
0032 try -fautolink 'autolink url with escaped spaces' \
0033     'http://\(here\ I\ am\)' \
0034     '<p><a href="http://(here%20I%20am)">http://(here I am)</a></p>'
0035 
0036 try -fautolink 'autolink café_racer' \
0037     'http://en.wikipedia.org/wiki/café_racer' \
0038     '<p><a href="http://en.wikipedia.org/wiki/caf%C3%A9_racer">http://en.wikipedia.org/wiki/caf%C3%A9_racer</a></p>'
0039 
0040 try -fautolink 'autolink url with arguments' \
0041     'http://foo.bar?a&b=c' \
0042     '<p><a href="http://foo.bar?a&amp;b=c">http://foo.bar?a&amp;b=c</a></p>'
0043 
0044 try '\( escapes in []()' \
0045     '[foo](http://a.com/\(foo\))' \
0046     '<p><a href="http://a.com/(foo)">foo</a></p>'
0047 
0048 try -fautolink 'autolink url with escaped ()' \
0049     'http://a.com/\(foo\)' \
0050     '<p><a href="http://a.com/(foo)">http://a.com/(foo)</a></p>'
0051 
0052 try -fautolink 'autolink url with escaped \' \
0053     'http://a.com/\\\)' \
0054     '<p><a href="http://a.com/\)">http://a.com/\)</a></p>'
0055 
0056 try -fautolink 'autolink url with -' \
0057     'http://experts-exchange.com' \
0058     '<p><a href="http://experts-exchange.com">http://experts-exchange.com</a></p>'
0059 
0060 try -fautolink 'autolink url with +' \
0061     'http://www67.wolframalpha.com/input/?i=how+old+was+jfk+jr+when+jfk+died' \
0062     '<p><a href="http://www67.wolframalpha.com/input/?i=how+old+was+jfk+jr+when+jfk+died">http://www67.wolframalpha.com/input/?i=how+old+was+jfk+jr+when+jfk+died</a></p>'
0063 
0064 try -fautolink 'autolink url with &' \
0065     'http://foo.bar?a&b=c' \
0066     '<p><a href="http://foo.bar?a&amp;b=c">http://foo.bar?a&amp;b=c</a></p>'
0067 
0068     
0069 try -fautolink 'autolink url with ,' \
0070     'http://www.spiegel.de/international/europe/0,1518,626171,00.html' \
0071     '<p><a href="http://www.spiegel.de/international/europe/0,1518,626171,00.html">http://www.spiegel.de/international/europe/0,1518,626171,00.html</a></p>'
0072 
0073 try -fautolink 'autolink url with : & ;' \
0074     'http://www.biblegateway.com/passage/?search=Matthew%205:29-30;&version=31;' \
0075     '<p><a href="http://www.biblegateway.com/passage/?search=Matthew%205:29-30;&amp;version=31;">http://www.biblegateway.com/passage/?search=Matthew%205:29-30;&amp;version=31;</a></p>'
0076 
0077 Q="'"
0078 try -fautolink 'security hole with \" in []()' \
0079 '[XSS](/ "\"=\"\"onmouseover='$Q'alert(String.fromCharCode(88,83,83))'$Q'")' \
0080 '<p><a href="/" title="\&quot;=\&quot;\&quot;onmouseover='$Q'alert(String.fromCharCode(88,83,83))'$Q'">XSS</a></p>'
0081 
0082 try -fautolink 'autolink and prefix fragment' \
0083 'xxxxxxx http://x.com/
0084 
0085 xxx xxxxht' \
0086 '<p>xxxxxxx <a href="http://x.com/">http://x.com/</a></p>
0087 
0088 <p>xxx xxxxht</p>'
0089 
0090 summary $0
0091 exit $rc