Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong HTML output when "bc.." is the very last in the document #81

Closed
kpot opened this issue Aug 31, 2022 · 1 comment
Closed

Wrong HTML output when "bc.." is the very last in the document #81

kpot opened this issue Aug 31, 2022 · 1 comment

Comments

@kpot
Copy link

kpot commented Aug 31, 2022

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.

kpot added a commit to kpot/python-textile that referenced this issue Aug 31, 2022
ikirudennis added a commit that referenced this issue Aug 5, 2024
Fix wrong output when "bc.." is the last block #81
ikirudennis added a commit that referenced this issue Sep 22, 2024
Version 4.0.3

* Update supported Python versions to 3.8 - 3.12 [#83](#83)
* Replace html5lib with nh3 for html sanitization
* General code cleanup
* Bugfixes:
**  Wrong HTML output when "bc.." is the very last in the document [#81](#81)
* Other:
** Use github actions instead of travis for automated testing
@ikirudennis
Copy link
Member

Test case is working as expected in v4.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants