diff --git a/CHANGELOG.textile b/CHANGELOG.textile index c998dd02..cc256bfe 100644 --- a/CHANGELOG.textile +++ b/CHANGELOG.textile @@ -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 diff --git a/tests/test_github_issues.py b/tests/test_github_issues.py index 27befff7..6b5b3d75 100644 --- a/tests/test_github_issues.py +++ b/tests/test_github_issues.py @@ -262,3 +262,37 @@ def test_issue_56(): result = textile.textile("- :=\n-") expect = '
This is some TEXT inside a "Code BLOCK"
+
+{
+ if (JSON) {
+
+ return {"JSON":"value"}
+ }
+}
+
+Back to 10-4 CAPS
+
+Some multiline Paragragh + +Here is some output!!! “Some” CAPS
''' + t = textile.Textile() + result = t.parse(input) + assert result == expect diff --git a/textile/core.py b/textile/core.py index 7572a468..a5dae835 100644 --- a/textile/core.py +++ b/textile/core.py @@ -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) diff --git a/textile/version.py b/textile/version.py index aaa42644..a29b27e7 100644 --- a/textile/version.py +++ b/textile/version.py @@ -1 +1 @@ -VERSION = '3.0.0' +VERSION = '3.0.1'