Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

failing to remove whitespace from markdown file #68

Closed
notslang opened this issue May 6, 2015 · 6 comments
Closed

failing to remove whitespace from markdown file #68

notslang opened this issue May 6, 2015 · 6 comments

Comments

@notslang
Copy link

notslang commented May 6, 2015

I ran into a markdown file that had a bunch of trailing whitespace. None of it was actually required for it to render properly, it was just there by mistake. So I opened & saved the file with Atom, expecting it to be stripped, but only some of it was (all the lines with 2 trailing spaces remained). Using the "Whitespace: Remove Trailing Whitespace" command also failed to strip it.

I think that this is the code responsible - some special logic for leaving 2 spaces alone in GFM.

I propose that we either remove this, since nearly the same thing can be accomplished if people who use trailing whitespace in their markdown added the following to their config:

".gfm.source":
  whitespace:
    removeTrailingWhitespace: false

...or at least make enabling it an option, since I only found out about it by reading the source.

@mik01aj
Copy link

mik01aj commented Feb 15, 2016

I'm having the same issue. I select some text in MD file, choose "Remove trailing whitespace" from menu and nothing happens.

Using Atom 1.4.1.

@notslang
Copy link
Author

There was a new configuration option (whitespace.keepMarkdownLineBreakWhitespace) introduced by af9edc6 that you have to edit, and right now it allows any whitespace greater than 1 character, rather than the previous stripping of anything that isn't 2 trailing spaces.

@mik01aj
Copy link

mik01aj commented Feb 15, 2016

I understand that you're talking about settings for automatic removing of whitespace when I save the file. This isn't the case here: I'm explicitly asking Atom to remove trailing whitespace by selecting the relevant menu option. Whatever the config, this option should definitely do what it says.

@notslang
Copy link
Author

Yeah, that would make sense (especially if you're running it on a selection), but this block of code is what's getting run, whether it's triggered manually or on save.

@mik01aj
Copy link

mik01aj commented Feb 15, 2016

Okay, good, so you know where is the bug coming from 😊

Shall we reopen it (@lee-dohm) or should I create a new issue?

@lee-dohm
Copy link
Contributor

@mik01aj Please open a new issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants