Trim trailing whitespace

I’d like have a plugin that trims trailing whitespace when a note is saved, and possibly leave one blank line at the end of the note.

Partly due to Automatic space inserted after selecting tag, and just day-to-day editing, I get random trailing whitespace and blank lines cluttering my files. As a programmer, with editors that know how to deal with it, this irks me.

I’m not sure how feasible it is, but if no-one else has done something similar I might give it a go.

2 Likes

Maybe some need it, but remember “forced line breaks” in Markdown (two spaces at the end of a line).

Hmm, that’s a good point. I don’t use them myself so that’s not a problem for me, but it probably should preserve those by default.

This plugin will trim extra spaces in a selection: GitHub - Benature/obsidian-text-format: Format seleted text in Obsdidian.md

2 Likes