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

Add option to ignore leading/trailing whitespace inside <a> tag #329

Open
ExplodingCabbage opened this issue Jul 1, 2020 · 2 comments
Open

Comments

@ExplodingCabbage
Copy link

  • Version by html2text --version

2020.1.16

  • Test script
echo 'Visit: <a href="http://example.com"> http://example.com </a>' | html2text

This produces:

Visit: [ http://example.com ](http://example.com)

but it would be nicer if it produced:

Visit: <http://example.com>

I recognise that theoretically the whitespace can be meaningful to the rendering of the HTML, but it just as often isn't, and having an option to ignore it would be nice. (In fact, I'd suggest that option should be the default.)

  • Python version python --version

Python 3.7.5

@jeremydouglass
Copy link

Such a default could cause problems. For one example:

While editing I<a href="foo.com"> highlighted this </a>wrong.

While editing Ihighlighted thiswrong.

@ExplodingCabbage
Copy link
Author

Fair point! I guess the default should remain unchanged, then.

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