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

Strip leading/trailing whitespace for links and inline code #376

Open
kevinoid opened this issue Mar 1, 2022 · 1 comment
Open

Strip leading/trailing whitespace for links and inline code #376

kevinoid opened this issue Mar 1, 2022 · 1 comment

Comments

@kevinoid
Copy link

kevinoid commented Mar 1, 2022

It would be great if the fix from #177 for #142, which strips leading and trailing whitespace for emphasis/strong/underline/strikethrough, could also be applied to links and inline code where leading and trailing space is stripped for white-space: normal.

html2text.html2text('<a href="https://example.com">\nExample\n</a>')
'[ Example ](https://example.com)\n\n'
>>> html2text.html2text('<code>\nx = 1\n</code>')
'` x = 1 `\n\n'
  • Version by html2text --version: 2020.1.16 (a3ed67b)
  • Test script: See above.
  • Python version python --version: 3.9.10

Related: #371

Thanks,
Kevin

@kevinoid
Copy link
Author

Potential duplicate (at least for inline links, if not code): #329

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

1 participant