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

Very first character of a converted file is a space character #205

Closed
185driver opened this issue Jul 4, 2020 · 4 comments
Closed

Very first character of a converted file is a space character #205

185driver opened this issue Jul 4, 2020 · 4 comments

Comments

@185driver
Copy link

Though this seems unlikely to be a bug (and more likely to be an issue on my end), I'll create this issue in the hope of resolving what I'm seeing.

Each time I convert an html document to a text file using html-to-text, the very first character of the resulting text file is a space character. It happens whether I use the CLI or nodejs and happens in whichever file I convert.

To reproduce this issue, copy/create the example html found here and convert it using basic syntax:

cat example/test.html | html-to-text > test.txt

This is what I see:

image

Is this confirmed for you too?

@KillyMXI
Copy link
Member

KillyMXI commented Jul 4, 2020

Interesting. Thank you for opening the issue.

We have tab-indented files for tests. But when you have space-indented document - this happens. It might have more than one space at the beginning.

(I suspect most people might just trim the output from html-to-text.)
I might've introduced this bug while trying to address improper space handling in a different place.
Now playing a whack-a-mole with spaces in current dodgy implementation.
Proper implementation requires major refactoring and I want to leave it for another release.

@KillyMXI
Copy link
Member

Finally, an update. Major refactoring was unavoidable, but now it all should work fine.

@KillyMXI
Copy link
Member

New version is now live in npm.

@185driver
Copy link
Author

Thank you for all your work! I look forward to giving the new version a spin.

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