<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -201,7 +201,7 @@ htmlblock(Paragraph *p, char *tag)
     closesize = sprintf(close, &quot;&lt;/%s&gt;&quot;, tag);
 
     for ( ; t ; t = t-&gt;next) {
-	if ( strncasecmp(T(t-&gt;text), close, closesize) == 0 ) {
+	if ( T(t-&gt;text)[0] == '&lt;' &amp;&amp; strcasestr(T(t-&gt;text), close) != NULL ) {
 	    ret = t-&gt;next;
 	    t-&gt;next = 0;
 	    return ret;</diff>
      <filename>ext/markdown.c</filename>
    </modified>
    <modified>
      <diff>@@ -82,6 +82,12 @@ class MarkdownTest &lt; Test::Unit::TestCase
     assert_equal &quot;&lt;p&gt;&lt;a href=\&quot;/search?query=Markdown+Test&amp;amp;page=2\&quot;&gt;Page 2&lt;/a&gt;&lt;/p&gt;\n&quot;, markdown.to_html
   end
 
+  def test_that_html_blocks_do_not_require_their_own_end_tag_line
+    markdown = Markdown.new(&quot;Para 1\n\n&lt;div&gt;&lt;pre&gt;HTML block\n&lt;/pre&gt;&lt;/div&gt;\n\nPara 2 [Link](#anchor)&quot;)
+    assert_equal &quot;&lt;p&gt;Para 1&lt;/p&gt;\n\n&lt;div&gt;&lt;pre&gt;HTML block\n&lt;/pre&gt;&lt;/div&gt;\n\n\n&lt;p&gt;Para 2 &lt;a href=\&quot;#anchor\&quot;&gt;Link&lt;/a&gt;&lt;/p&gt;\n&quot;,
+      markdown.to_html
+  end
+
   # Build tests for each file in the MarkdownTest test suite
 
   Dir[&quot;#{MARKDOWN_TEST_DIR}/Tests/*.text&quot;].each do |text_file|</diff>
      <filename>test/markdown_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6c219beca75e86c5a9866449ff062ea1feceed0f</id>
    </parent>
  </parents>
  <author>
    <name>Geoff Garside</name>
    <login></login>
    <email>geoff@geoffgarside.co.uk</email>
  </author>
  <url>http://github.com/rtomayko/rdiscount/commit/6bc35d19747f0ecc71223507663910ccf412b1af</url>
  <id>6bc35d19747f0ecc71223507663910ccf412b1af</id>
  <committed-date>2009-03-18T04:32:48-07:00</committed-date>
  <authored-date>2009-03-14T05:38:20-07:00</authored-date>
  <message>Recognize htmlblock close tags anywhere in line

Previously htmlblock() could only detect a closing tag if it was on
its own on a line. Unfortunately the Pygments library when generating
code blocks with line numbers does not put the closing &lt;/table&gt; on
its own line. Instead it writes it as &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;, in this
form the Discount library would not detect the closing tag and would
interpret the remainder of the document as HTML.

Signed-off-by: Ryan Tomayko &lt;rtomayko@gmail.com&gt;

NOTE: The original patch included modifications for the Markdown
conformance suite. I didn't want to modify the conformance suite
directly so I created a simple test case in test/markdown_test.rb</message>
  <tree>94a601a1e775bd0b9df65521a6a911ffc287b3d9</tree>
  <committer>
    <name>Ryan Tomayko</name>
    <login>rtomayko</login>
    <email>rtomayko@gmail.com</email>
  </committer>
</commit>
