-
Notifications
You must be signed in to change notification settings - Fork 265
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
Different results when HTML2Text
object is reused
#375
Comments
Hello, I reproduced: >>> html2text = HTML2Text()
>>> html2text.handle("hello")
'hello\n\n'
>>> html2text.handle("hello")
'hello\n\n' # Consistent without HTML tags.
>>>
>>> html2text = HTML2Text()
>>> html2text.handle("<h2>hello</h2>")
'## hello\n\n'
>>> html2text.handle("<h2>hello</h2>")
'\n\n## hello\n\n' # We have an extra '\n\n' at the beginning
>>>
>>> html2text = HTML2Text()
>>> html2text.handle("<strong>hello</strong>")
'**hello**\n\n'
>>> html2text.handle("<strong>hello</strong>")
' **hello**\n\n' # We have an extra ' ' at the beginning |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version by
html2text --version
html2text==2020.1.16
Python version
python --version
3.8.8 on Ubuntu WSL2
Test script:
Results:
(Should be 3 x
True
)(I suggest adding unit test for this issue, after this is fixed)
index.html file (encoded in UTF-8):
The text was updated successfully, but these errors were encountered: