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

0001 . tests/functions.sh
0002 
0003 title "html blocks"
0004 
0005 rc=0
0006 MARKDOWN_FLAGS=
0007 
0008 try 'self-closing block tags (hr)' \
0009     '<hr>
0010 
0011 text' \
0012     '<hr>
0013 
0014 
0015 <p>text</p>'
0016 
0017 try 'self-closing block tags (hr/)' \
0018     '<hr/>
0019 
0020 text' \
0021     '<hr/>
0022 
0023 
0024 <p>text</p>'
0025 
0026 try 'no smartypants inside tags (#1)' \
0027     '<img src="linky">' \
0028     '<p><img src="linky"></p>'
0029 
0030 try 'no smartypants inside tags (#2)' \
0031     '<img src="linky" alt=":)" />' \
0032     '<p><img src="linky" alt=":)" /></p>'
0033 
0034 try -fnohtml 'block html with -fnohtml' '<b>hi!</b>' '<p>&lt;b>hi!&lt;/b></p>'
0035 try -fnohtml 'malformed tag injection' '<x <script>' '<p>&lt;x &lt;script></p>'
0036 try -fhtml 'allow html with -fhtml' '<b>hi!</b>' '<p><b>hi!</b></p>'
0037 
0038 
0039 # check that nested raw html blocks terminate properly.
0040 #
0041 BLOCK1SRC='Markdown works fine *here*.
0042 
0043 *And* here.
0044 
0045 <div><pre>
0046 </pre></div>
0047 
0048 Markdown here is *not* parsed by RDiscount.
0049 
0050 Nor in *this* paragraph, and there are no paragraph breaks.'
0051 
0052 BLOCK1OUT='<p>Markdown works fine <em>here</em>.</p>
0053 
0054 <p><em>And</em> here.</p>
0055 
0056 <div><pre>
0057 </pre></div>
0058 
0059 
0060 <p>Markdown here is <em>not</em> parsed by RDiscount.</p>
0061 
0062 <p>Nor in <em>this</em> paragraph, and there are no paragraph breaks.</p>'
0063 
0064 try 'nested html blocks (1)' "$BLOCK1SRC" "$BLOCK1OUT"
0065 
0066 try 'nested html blocks (2)' \
0067     '<div>This is inside a html block
0068 <div>This is, too</div>and
0069 so is this</div>' \
0070     '<div>This is inside a html block
0071 <div>This is, too</div>and
0072 so is this</div>'
0073 
0074 try 'unfinished tags' '<foo bar' '<p>&lt;foo bar</p>'
0075 
0076 
0077 try 'block with trailing text' '<p>this is</p>a test' \
0078 '<p>this is</p>
0079 
0080 
0081 <p>a test</p>'
0082 
0083 try 'unclosed block' '<p>here we go!' '<p><p>here we go!</p>'
0084 
0085 
0086 try '<form> block' '<form>
0087 
0088 pie?
0089 
0090 </form>' '<form>
0091 
0092 pie?
0093 
0094 </form>'
0095 
0096 try 'code inside a blockquote' \
0097 '><form stuff>
0098 stuff
0099 </form>' \
0100 '<blockquote><form stuff>
0101 stuff
0102 </form>
0103 </blockquote>'
0104 
0105 try 'multi-line html with trailing text' \
0106 '<p>test test test
0107     test test test</p>+' \
0108 '<p>test test test
0109     test test test</p>
0110 
0111 
0112 <p>+</p>'
0113 
0114 summary $0
0115 exit $rc