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

Don't clear trailing whitespace #245

Closed
levouh opened this issue Jul 27, 2021 · 2 comments
Closed

Don't clear trailing whitespace #245

levouh opened this issue Jul 27, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@levouh
Copy link

levouh commented Jul 27, 2021

Describe the problem

Markdown defines that two trailing spaces means a new line, hence trailing whitespace shouldn't be cleared from the document when running mdformat (see here).

Link to your repository or website

No response

Steps to reproduce

  1. Create a .md file
  2. Write a line, say a block quote, that has trailing whitespace like:
>this line has two trailing spaces after it  
>so that this is actually a newline
  1. Run mdformat on the file
  2. Observe the failure to preserve the whitespace

The version of Python you're using

3.9

Your operating system

Linux 5.12 kernel

Versions of your packages

mdformat 0.7.7
mdformat-gfm 0.3.2
mdformat-tables 0.4.1

Additional context

No response

@levouh levouh added the bug Something isn't working label Jul 27, 2021
@welcome
Copy link

welcome bot commented Jul 27, 2021

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@levouh
Copy link
Author

levouh commented Jul 27, 2021

Closing per the documentation stating:

Hard line breaks are always a backslash preceding a line ending. The alternative syntax, two or more spaces before a line ending, is not used because it is not visible.

@levouh levouh closed this as completed Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant