Aram Dulyan avatar Aram Dulyan committed 0843a03

Fixed orphan tags occurring when simple tags were broken up by more than one <br/> tag.

Comments (0)

Files changed (2)

             else:
                 # Since Textile doesn't allow simple tags to span across
                 # line breaks, close them and reopen them after the break
+                blank_line = False
+                for open_tag in self.open_simple_tags:
+                    blank_line = blank_line or self._rstrip_open_tag(open_tag)
                 textile = '%s\n%s' % (
-                    ''.join(self.open_simple_tags),
+                    ''.join(self.open_simple_tags) if not blank_line else '',
                     ''.join(reversed(self.open_simple_tags)),
                 )
         elif tag == 'blockquote':
 Three.
 Four.
 
+Test that blank lines remain blank
+>>> convert('<span><span>One.<br /></span><br />Two.</span>')
+%Text.%
+<BLANKLINE>
+%Two.%
+
 
 Ensure sole images aren't unnecessarily indented.
 >>> convert('<div>Text.</div><div><img src="image.jpg" /></div>')
 >>> convert('<p><span style="color: navy"><span><a href="example.com">Link</a></span></span></p>')
 "%Link%":example.com
 
-Test that behaviour is consistent across paragraps.
+Test that behaviour is consistent across paragraphs.
 >>> convert('<p><em><strong><a href="example.com">Link</a></strong></em></p>\
              <p><em><strong><a href="example.com">Link</a></strong></em></p>')
 "_*Link*_":example.com
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.