ebullient14k downloadsCSS styles and CM6 extensions to highlight whitespace in Source and Live Preview modes.
This is a simple plugin to enable CodeMirror 6 extensions to highlight whitespace in both Source and Live Preview modes.
Basic CSS styling provided by the plugin renders characters for whitespace at the beginning and ending of lines (not in the middle) for readability.
The plugin provides a few options to customize the look and feel of whitespace characters.
You can also completely disable the plugin's CSS and use your own.
style.css into your own CSS snippetOnce enabled, the plugin always shows leading space (as that is the hardest to see). Display of inner/trailing spaces depends on configuration.
Plugin disabled:
Show all whitespace; outline list markers:
Leading/Trailng whitespace; outline list markers:

Redefine --line-end or --line-break to change how those characters appear in a snippet.
body {
--line-end: '¬';
--line-break: '↲';
}
To install:
Settings -> Community PluginsSettings -> Community Plugins.Settings -> Obsidian 42 - BRAT).Beta Plugin List section, click Add Beta Plugin.ebullient/obsidian-show-whitespace-cm6.Settings -> Community Plugins.Pull requests are both welcome and appreciated. 😀
Interested in supporting further development? Consider buying me a coffee!
While this is a new implementation for CM6, styles and characters are inspired by behavior in VSCode and the original Show Whitespace plugin by death_au.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.