File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed
Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff 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 "Code BLOCK"
283+
284+ {
285+ if (JSON) {
286+
287+ return {"JSON":"value"}
288+ }
289+ }
290+
291+ Back to 10-4 CAPS </code></pre>
292+
293+ <p>Some multiline Paragragh
294+
295+ Here is some output!!! “Some” <span class="caps">CAPS</span></p>'''
296+ t = textile .Textile ()
297+ result = t .parse (input )
298+ assert result == expect
Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments