Skip to content

Commit a5a89b7

Browse files
committed
Merge branch 'release/3.0.1'
2 parents 8b8d973 + 8027fda commit a5a89b7

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed

CHANGELOG.textile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
h1. Textile Changelog
22

3+
h2. Version 3.0.1
4+
* BUGFIX: Fix improper handling of extended code blocks. ("#61":https://github.com/textile/python-textile/pull/61)
5+
36
h2. Version 3.0.0
47
* Drop support for Python 2.6 and 3.2.
58
* Update to the current version of html5lib

tests/test_github_issues.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,3 +262,37 @@ def test_issue_56():
262262
result = textile.textile("- :=\n-")
263263
expect = '<dl>\n</dl>'
264264
assert result == expect
265+
266+
def test_github_issue_57():
267+
input = '''bc.. This is some TEXT inside a "Code BLOCK"
268+
269+
{
270+
if (JSON) {
271+
272+
return {"JSON":"value"}
273+
}
274+
}
275+
276+
Back to 10-4 CAPS
277+
278+
p.. Some multiline Paragragh
279+
280+
Here is some output!!! "Some" CAPS'''
281+
282+
expect = '''<pre><code>This is some TEXT inside a &quot;Code BLOCK&quot;
283+
284+
{
285+
if (JSON) {
286+
287+
return {&quot;JSON&quot;:&quot;value&quot;}
288+
}
289+
}
290+
291+
Back to 10-4 CAPS </code></pre>
292+
293+
<p>Some multiline Paragragh
294+
295+
Here is some output!!! &#8220;Some&#8221; <span class="caps">CAPS</span></p>'''
296+
t = textile.Textile()
297+
result = t.parse(input)
298+
assert result == expect

textile/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ def block(self, text):
503503
block.outer_atts)
504504
line = "\t{0}".format(line)
505505
else:
506-
if block.tag == 'pre':
506+
if block.tag == 'pre' or block.inner_tag == 'code':
507507
line = self.shelve(encode_html(line, quotes=True))
508508
else:
509509
line = self.graf(line)

textile/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '3.0.0'
1+
VERSION = '3.0.1'

0 commit comments

Comments
 (0)