deathau / cm-show-whitespace-obsidian

A plugin for [Obsidian](https://obsidian.md) which shows whitespace in the editor.
53 stars 6 forks source link

A CSS Snippet to work with newer versions of Obsidian #22

Open loikein opened 1 year ago

loikein commented 1 year ago

Edit in 2024: You may find ebullient/obsidian-show-whitespace-cm6 useful.


Hi folks, I have gathered the following snippet to make this plugin work with Obsidian v1.3.7 (more or less, I forgot how it used to work and wrote it for my own needs). Please feel free to use and make changes. Cheers.

Edit: The br fixes do not work on iOS.

Edit 2: Added new line indicators for non-empty lines.

Please consult the doc if you are new to the snippets.

Details ```css body.plugin-cm-show-whitespace [class*=cm-trailing-space]::after, body.plugin-cm-show-whitespace [class*=cm-trailing-space]::before { color: var(--text-muted); } .cm-line br { content: " "; display: inline-block; } .cm-line br::after, .cm-line:not(:has(br)):not(:has(.cm-trailing-space-new-line))::after { content: var(--newlineChar); white-space: pre; pointer-events: none; color: var(--text-muted); font-weight: normal; opacity: 0.5; padding-inline-start: 2px; } ```
notDavid commented 9 months ago

Newlines work, but it doesn't show whitespaces for me. If someone gets it working, please post the solution here... thank you!

-- Obsidian 1.4.16