FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Forgot to set multiline_para to False by Igoranze · Pull Request #63 · textile/python-textile · GitHub

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

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
64 changes: 64 additions & 0 deletions tests/test_github_issues.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL