Skip to content

Commit

Permalink
Merge branch 'release/3.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ikirudennis committed Apr 10, 2018
2 parents 8b8d973 + 8027fda commit a5a89b7
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.textile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
h1. Textile Changelog

h2. Version 3.0.1
* BUGFIX: Fix improper handling of extended code blocks. ("#61":https://github.com/textile/python-textile/pull/61)

h2. Version 3.0.0
* Drop support for Python 2.6 and 3.2.
* Update to the current version of html5lib
Expand Down
34 changes: 34 additions & 0 deletions tests/test_github_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,37 @@ def test_issue_56():
result = textile.textile("- :=\n-")
expect = '<dl>\n</dl>'
assert result == expect

def test_github_issue_57():
input = '''bc.. This is some TEXT inside a "Code BLOCK"
{
if (JSON) {
return {"JSON":"value"}
}
}
Back to 10-4 CAPS
p.. Some multiline Paragragh
Here is some output!!! "Some" CAPS'''

expect = '''<pre><code>This is some TEXT inside a &quot;Code BLOCK&quot;
{
if (JSON) {
return {&quot;JSON&quot;:&quot;value&quot;}
}
}
Back to 10-4 CAPS </code></pre>
<p>Some multiline Paragragh
Here is some output!!! &#8220;Some&#8221; <span class="caps">CAPS</span></p>'''
t = textile.Textile()
result = t.parse(input)
assert result == expect
2 changes: 1 addition & 1 deletion textile/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def block(self, text):
block.outer_atts)
line = "\t{0}".format(line)
else:
if block.tag == 'pre':
if block.tag == 'pre' or block.inner_tag == 'code':
line = self.shelve(encode_html(line, quotes=True))
else:
line = self.graf(line)
Expand Down
2 changes: 1 addition & 1 deletion textile/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '3.0.0'
VERSION = '3.0.1'

0 comments on commit a5a89b7

Please sign in to comment.