This is such a standard editor feature that I am amazed that:
it was not implemented yet
(based on a search) I am the first one to request this feature/fix.
There is a lot of reasons why trailing spaces should be removed, be it in a programming context (I do use Obsidian to document code and I use git to sync the changes) or just in a general writing context. Here is one of the discussions:
Proposed solution
Start deleting extra trailing spaces at the end of the lines. I don’t know why would anybody need those extra spaces, thus I can’t think of a reason to have a setting toggle to disable trimming.
Or does it mean that both Obsidian and Typora have a bug and are not treating the trailing spaces like the Markdown standard instructs? That would speak loudly about the badness and unusefulness of this trailing space specification; the fact that nobody misses this feature enough to report and fix it.
Which is a good thing - it means that nothing stops Obsidian developers from taking the practical approach and implementing the common trimming feature.
There are different format standards/specifications, most of them having some sort of weaknesses. Markdown is no different. It is a good standard, but also has problems of its own - this double trailing space is clearly one of the design-choices-that-shouldn’t-have-happened. If anything, it sounds like a purposefully badly designed thing, a homage to the Whitespace programming language. This is terrible.
After extensive researching, I found out that:
Most people agree that this is a bad/unnecessary specification
The trailing space syntax is not commonly used
Different software are not supporting it or are trimming the trailing spaces by default. Including the VSCode and JetBrains editors. And basically nobody minds.
The whole “trailing spaces” thing in Markdown is badly specified and implemented. For example the official implementation of Markdown strips leading and trailing whitespace in code spans and people are fine with it.
The original description does not specify the syntax unambiguously and there have been many different implementations of Markdown. So it’s ok to make changes to Markdown to fit the unique situation (e.g. Github flavored Markdown, or the practical approach the Obsidian developers took so far - to generally embrace the Markdown, but with their own additions/removal/changes when necessary; officially removing support for the unnecessary trailing spaces syntax should be one of those).
Just ran into this problem today, where my frontmatter wouldn’t parse, causing Live Preview to fail, because I had trailing whitespaces after my closing ---.
We’re not talking about leading whitespaces here, e.g., Python where indentation denotes lexical scoping.
From a usability standpoint, it is evil to be cut by invisible wounds.