Skip to content

Commit 6ce46ad

Browse files
Forgot to set multiline_para to False, Code block multiline did not render because of it
1 parent 51cbf11 commit 6ce46ad

2 files changed

Lines changed: 67 additions & 0 deletions

File tree

tests/test_github_issues.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,3 +336,67 @@ def test_issue_58():
336336
t = textile.Textile()
337337
result = t.parse(input)
338338
assert result == expect
339+
340+
def test_issue_59():
341+
input = '''p.. First one 'is'
342+
343+
ESCAPED "bad"
344+
345+
bc.. {
346+
First code BLOCK
347+
348+
{"JSON":'value'}
349+
}
350+
351+
p.. Second one 'is'
352+
353+
354+
355+
ESCAPED "bad"
356+
357+
p.. Third one 'is'
358+
359+
ESCAPED "bad"
360+
361+
bc.. {
362+
Last code BLOCK
363+
364+
{"JSON":'value'}
365+
}
366+
367+
p.. Last one 'is'
368+
369+
ESCAPED "good" test'''
370+
371+
expect = '''<p>First one &#8216;is&#8217;</p>
372+
373+
<p><span class="caps">ESCAPED</span> &#8220;bad&#8221;</p>
374+
375+
<pre><code>{
376+
First code BLOCK
377+
378+
{&quot;JSON&quot;:&#39;value&#39;}
379+
}</code></pre>
380+
381+
<p>Second one &#8216;is&#8217;</p>
382+
383+
384+
385+
<p><span class="caps">ESCAPED</span> &#8220;bad&#8221;</p>
386+
387+
<p>Third one &#8216;is&#8217;</p>
388+
389+
<p><span class="caps">ESCAPED</span> &#8220;bad&#8221;</p>
390+
391+
<pre><code>{
392+
Last code BLOCK
393+
394+
{&quot;JSON&quot;:&#39;value&#39;}
395+
}</code></pre>
396+
397+
<p>Last one &#8216;is&#8217;</p>
398+
399+
<p><span class="caps">ESCAPED</span> &#8220;good&#8221; test</p>'''
400+
t = textile.Textile()
401+
result = t.parse(input)
402+
assert result == expect

textile/core.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,9 @@ def block(self, text):
536536
else:
537537
line = self.doPBr(line)
538538

539+
if not block.tag == 'p':
540+
multiline_para = False
541+
539542
line = line.replace('<br>', '<br />')
540543

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

0 commit comments

Comments
 (0)