Skip to content

Commit 479d618

Browse files
committed
tweak block processing to fix #50
1 parent 503d5f9 commit 479d618

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

tests/test_github_issues.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,13 @@ def test_github_issue_49():
173173
result = textile.textile(s)
174174
expect = '\t<p><a href="https://ru.vuejs.org/v2/guide/components.html#Входные-параметры">link</a></p>'
175175
assert result == expect
176+
177+
def test_github_issue_50():
178+
"""Incorrect wrap code with Java generics in pre"""
179+
test = ('pre.. public class Tynopet<T extends Framework> {}\n\nfinal '
180+
'List<List<String>> multipleList = new ArrayList<>();')
181+
result = textile.textile(test)
182+
expect = ('<pre>public class Tynopet&lt;T extends Framework&gt; {}\n\n'
183+
'final List&lt;List&lt;String&gt;&gt; multipleList = new '
184+
'ArrayList&lt;&gt;();</pre>')
185+
assert result == expect

textile/core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,10 @@ def block(self, text):
534534
# at this point, we've gone through all the lines, and if there's still
535535
# an extension in effect, we close it here.
536536
if ext and out:
537-
final = generate_tag(block.outer_tag, out.pop(), block.outer_atts)
537+
block.content = out.pop()
538+
block.process()
539+
final = generate_tag(block.outer_tag, block.content,
540+
block.outer_atts)
538541
out.append(final)
539542
return ''.join(out)
540543

0 commit comments

Comments
 (0)