Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions tests/test_github_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,3 +336,67 @@ def test_issue_58():
t = textile.Textile()
result = t.parse(input)
assert result == expect

def test_issue_59():
input = '''p.. First one 'is'

ESCAPED "bad"

bc.. {
First code BLOCK

{"JSON":'value'}
}

p.. Second one 'is'



ESCAPED "bad"

p.. Third one 'is'

ESCAPED "bad"

bc.. {
Last code BLOCK

{"JSON":'value'}
}

p.. Last one 'is'

ESCAPED "good" test'''

expect = '''<p>First one &#8216;is&#8217;</p>

<p><span class="caps">ESCAPED</span> &#8220;bad&#8221;</p>

<pre><code>{
First code BLOCK

{&quot;JSON&quot;:&#39;value&#39;}
}</code></pre>

<p>Second one &#8216;is&#8217;</p>



<p><span class="caps">ESCAPED</span> &#8220;bad&#8221;</p>

<p>Third one &#8216;is&#8217;</p>

<p><span class="caps">ESCAPED</span> &#8220;bad&#8221;</p>

<pre><code>{
Last code BLOCK

{&quot;JSON&quot;:&#39;value&#39;}
}</code></pre>

<p>Last one &#8216;is&#8217;</p>

<p><span class="caps">ESCAPED</span> &#8220;good&#8221; test</p>'''
t = textile.Textile()
result = t.parse(input)
assert result == expect
3 changes: 3 additions & 0 deletions textile/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,9 @@ def block(self, text):
else:
line = self.doPBr(line)

if not block.tag == 'p':
multiline_para = False

line = line.replace('<br>', '<br />')

# if we're in an extended block, and we haven't specified a new
Expand Down