File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ‘is’</p>
372+
373+ <p><span class="caps">ESCAPED</span> “bad”</p>
374+
375+ <pre><code>{
376+ First code BLOCK
377+
378+ {"JSON":'value'}
379+ }</code></pre>
380+
381+ <p>Second one ‘is’</p>
382+
383+
384+
385+ <p><span class="caps">ESCAPED</span> “bad”</p>
386+
387+ <p>Third one ‘is’</p>
388+
389+ <p><span class="caps">ESCAPED</span> “bad”</p>
390+
391+ <pre><code>{
392+ Last code BLOCK
393+
394+ {"JSON":'value'}
395+ }</code></pre>
396+
397+ <p>Last one ‘is’</p>
398+
399+ <p><span class="caps">ESCAPED</span> “good” test</p>'''
400+ t = textile .Textile ()
401+ result = t .parse (input )
402+ assert result == expect
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments