Commits

David Chambers committed f40cc0c

Updated regular expression to match an h1 without matching an h[2-6].

  • Participants
  • Parent commits a3ac9e7
  • Branches 0.8

Comments (0)

Files changed (2)

             [^\n]*\n
           )+?
         )
-        (?= \# | .+\n={3,} )                # followed by an h1 of either type
+        (?= \#(?!\#) | .+\n={3,} )          # followed by an h1 of either type
         ''', re.VERBOSE).sub
 
     def _pluckhandcraftedexcerpt(self, references):

tests/__init__.py

                          '<p>This is the first part of the excerpt.</p>\n'
                          '<p>This is the rest of the excerpt.</p>')
 
+    @md('''
+        This is *not* an excerpt.
+        
+        ## Subheading
+        
+        Paragraph.
+        ''')
+    def test_subheading(self, document):
+        self.assertFalse(document._excerpt)
+
 
 class FileNameTests(unittest.TestCase):