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

Semicolon in Text with &#. #369

Open
radze90 opened this issue Jul 22, 2021 · 1 comment
Open

Semicolon in Text with &#. #369

radze90 opened this issue Jul 22, 2021 · 1 comment

Comments

@radze90
Copy link

radze90 commented Jul 22, 2021

html2text version 2020.1.16
Python version 3.9.5

import html2text

test = html2text.HTML2Text()
text = test.handle("<p>Sample text K&N. Sample text.</p>")
print(text)

output:
Sample text K&N.; Sample text.

Hi,

I noticed that the module inserts a simcolon in the text when converting a certain string, which I don't want. It doesn't matter which character comes after the &. Is this intentional and is it possible to work around this or is this a bug?

@MonkzCode
Copy link

I confirm this issue.

My sample:

ZZZ
ZZ&Z
ZZ#Z
https://some.site.com/index.php?r=billMail/confirmNewBillMail&code=pYgJeYbpnSsaGdSRoKgfa9bd0fb4248dbb437c745afbb6d1b29tvPsONXEQApNxxswCSZ

Output after html2text:

ZZZ
ZZ&Z;
ZZ#Z
https://some.site.com/index.php?r=billMail/confirmNewBillMail&code;=pYgJeYbpnSsaGdSRoKgfa9bd0fb4248dbb437c745afbb6d1b29tvPsONXEQApNxxswCSZ

@Alir3z4 please, fix this. We cant use html2text to parse URLs since html2text add semicolon into URL.

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