Markdown nested lists are reformatted incorrectly upon save


#1

Hello Folks,

I’m currently writing some documentation in Markdown using Atom. I’ve recently bumped into an issue that I can’t seem to find a way to fix. For example I’m writing a nested list like the following:

- item one
    - item two
        - item three

Whenever I save the document, Atom decides to reformat my list as follows:

- item one
  - item two
  - item three

Basically I can’t have a list that is nested at more than one level. I’m currently using the built-in language-gfm syntax, and I can’t seem to find a way to stop this destructive behaviour. Could anyone please assist me with this?

Thank you.


#2

Does it happen in safe mode? I can’t reproduce it.


#3

@Aerijo Thanks for getting back to me. I think I have identified the issue: language-gfm by default has a tab size of 2, however, due to a bug in Blackfriday I needed a tab size of 4. I think language-gfm was actually behaving as expected, by amending my “half” tabs. I have fixed the issue by changing the tab size to 4.


#4

I’m not sure that language-gfm is responsible for the reformmating, since that’s beyond the scope of a core language package. The most likely answer from my experience is that you have atom-beautify running on save.