Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Showing all spaces breaks words in Editor mode #253

Open
2 of 6 tasks
LS-Localicows opened this issue Mar 1, 2025 · 1 comment
Open
2 of 6 tasks

🐛 Showing all spaces breaks words in Editor mode #253

LS-Localicows opened this issue Mar 1, 2025 · 1 comment

Comments

@LS-Localicows
Copy link

Expected Behavior

(Hello and thank you for the plugin!)
Expected: showing whitespace between words would not disrupt the text's layout, i.e. space dots would be visible without it changing anything else.
For reference, here is some text from a Wikipedia article, with and without showing all whitespace (in LibreOffice). The words' position remains the same. I expected a similar behaviour in Obsidian with your plugin, and I am almost certain that it used to work that way.

Image

Image

Current behaviour

Showing all whitespace apparently makes each line slightly longer, causing it to break even in the middle of a word.

Image

As you can see in this screenshot, the same text in Obsidian has line breaks inside words, instead of before/after words.

This happens in both standard editing mode and in "source mode", when the "show all whitespace" option is enabled.
Showing only trailing spaces (as per the plugin's default setting) apparently does not break the text in such a manner (kindly see below).

Image

(Both screenshots were taken in an Obsidian Sandbox instance with only this plugin installed.)
I would like to know how to see whitespace in editing mode without it disrupting the text's layout this way. Having each line a bit longer because of the space dots is not a problem in itself; the real issue is the random line breaks.
Thank you in advance for having a look into it!

Steps to reproduce

  1. Launch Obsidian Sandbox (or even an existing vault);
  2. Install the plugin;
  3. Enable the "show all whitespace" option in the plugin settings;
  4. Type in or paste some text long enough to see line breaks.

Which Operating Systems are you using?

  • Android
  • iPhone/iPad
  • Linux
  • macOS
  • Windows

Obsidian Version

1.8.7

Plugin Version

0.2.7

Checks

  • I have tried it in the sandbox vault with only this plugin enabled

Possible solution

Perhaps this might be linked to the width of each space dot? If so, some change in CSS might be a solution?
I am almost positive that this issue did not happen a few months ago, so there could also be a risk that it stems from Obsidian and not your plugin. Unfortunately, I don't really know how to spot the issue's origin.
Feel free to reach out if you need any additional details or if you think I could help you sort it out (perhaps checking if the issue also arises with other OSes than Linux). In any case, thank you again for providing this plugin in the first place!

@ebullient
Copy link
Owner

The issue may come from the codemirror plugin, which significantly changed how it rendered/marked whitespace (fixed in 0.2.7).

I only have the markup I have. You'd have to use the Developer console to highlight the space in question to see what styles are involved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants