python-textile
python-textile copied to clipboard
Wrong HTML output when "bc.." is the very last in the document
Hi!
Given the following Textile document (in a form of a Python string):
bc.. Paragraph 1\n\nParagraph 2\n\nParagraph 3
python-textile outputs
"<pre>Paragraph 1\n\nParagraph 2\n\nParagraph 3</pre>"
When it should be producing
"<pre><code>Paragraph 1\n\nParagraph 2\n\nParagraph 3</code></pre>"
This happens only when the "bc.." block is the very last or the only block of the document. If it is followed by anything else, say a p. Extra text
block, the resulting HTML is correct.
I'm currently working on porting python-textile to Rust, so I'm quite familiar with the code and plan to fix the bug myself. I'll send a PR with some extra tests.