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

inline tags within strong/strike/u/i/em/... do not handle spaces correctly #371

Open
mrh1997 opened this issue Oct 12, 2021 · 0 comments · May be fixed by #372
Open

inline tags within strong/strike/u/i/em/... do not handle spaces correctly #371

mrh1997 opened this issue Oct 12, 2021 · 0 comments · May be fixed by #372

Comments

@mrh1997
Copy link

mrh1997 commented Oct 12, 2021

Some inline tags require removing space between text and markdown (<strong>TEXT </string> => **TEXT**)

When adding another inline tag within these tags space removal does not work proper any more:

from html2text import html2text
print(html2text("<b><a>X</a></b>")))   # returns "**X**" => OK
print(html2text("<b>X </b>")))         # returns "**X**" => OK
print(html2text("<b><a>X</a> </b>")))  # returns "**X **" => INVALID  (expected "**X**")
print(html2text("<b>X <a>Y</a></b>")))  # returns "**XY**" => INVALID (expected "**X Y**")
  • Version by html2text --version: 2020.1.16
  • Python version python --version: 3.6.3
@mrh1997 mrh1997 changed the title inline tags within strong/strike/u/i/em/... does not handle spaces correctly inline tags within strong/strike/u/i/em/... do not handle spaces correctly Oct 12, 2021
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

Successfully merging a pull request may close this issue.

1 participant