Steps to reproduce
- Create a new note and type
a b(with one or more spaces in between). - Place the cursor at the end of
a(i.e., right before the first space), or place it betweenaand the spaces. - Press
Enter.
Did you follow the troubleshooting guide? [Y/N]
Y
Expected result
The spaces should be preserved. After the line break, the new line should start with a space:
a
b
Actual result
All spaces between the two characters are deleted, and the text becomes:
a
b
Environment
SYSTEM INFO:
Obsidian version: 1.13.7
Installer version: 1.8.10
Operating system: Windows 11 Home China 10.0.26200
Login status: logged in
Language: zh
Catalyst license: none
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on
RECOMMENDATIONS:
none
Additional information
- The number of spaces does not matter — whether 1 or 20, all spaces are removed when pressing
Enter. - If there is no preceding text (e.g., typing
band pressingEnterbefore the spaces), the spaces are preserved. This indicates inconsistent behavior between “leading spaces” and “inline spaces.” - This bug does not occur inside blockquotes (
>) or fenced code blocks (```) — spaces are preserved as expected in those contexts. - I tested the same operation in other editors for comparison:
| Environment | Preserve inline spaces? |
|---|---|
| Windows Notepad | Yes |
| VS Code | Yes |
| dillinger - online | Yes |
| Stacjedit - online | Yes |
| Plainly - online | Yes |
| markdown.com.cn | Yes |
| MeTool - online | No |
I checked CodeMirror’s deleteMarkupBackward fix (v6.1.1, released Aug 2023), but it appears unrelated.