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

Double empty line between articles. #2

Open
webdev23 opened this issue Oct 30, 2021 · 3 comments
Open

Double empty line between articles. #2

webdev23 opened this issue Oct 30, 2021 · 3 comments

Comments

@webdev23
Copy link

It does works, however, beside being horribly slow; it has a major issue.

It should separate articles with two empty lines, which it does, sometimes.

\n\n

but NOT on all articles.

\n

This makes the text output impossible to parse on a large scale, since no consistency is taken, it can happen everywhere.

And I am sure peoples had spent a lot of time figuring it out, as I did, and have end-up to abandon their project completly.

:/

@mr-martian
Copy link

My guess would be that some, but not all, articles end with a newline, and this is the source of the issue.

You could try changing line 456 to return text.rstrip() + '\n' (or '\n\n') and see if that works better.

@webdev23
Copy link
Author

webdev23 commented Oct 30, 2021

Thanks for the extra quick reply, at first.

I understand the origin of the issue, as you described. However, this won't add the wanted consistency, as some articles will be separated by two empty lines, and some other by three.

Of course, this would make the output parse able, so it can be a solution.

I am sure a simple test condition, or trimming, can render the output simpler to parse.

Thank you.

@mr-martian
Copy link

I understand the origin of the issue, as you described. However, this won't add the wanted consistency, as some articles will be separated by two empty lines, and some other by three.

That's what the .rstrip() is for, it will remove the final newline, if there is one, so that there will always be 2 in the final output.

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