Below is a screenshot with Obsidian on the left and a text editor (Zed) on the right. The text pasted is exactly the same, but Obsidian’s formatting is inconsistent and ugly.
I searched for topics on editor alignment and formatting in Obsidian and didn’t find any useful things. I am using a Prettier plugin for Obsidian which is how I discovered this issue.
I ran the format command within Obsidian and the file formatted to what you see above. This confused me, so I tested copying the Obsidian text in to other text editors like Zed, VSCode, and TextEdit. The text editors all display the text as aligned; it’s only Obsidian that looks wonky.
Note that the spots where you see misalignment on Obsidian are not extra spaces or characters. I’m using the Berkeley Mono font in the screenshot, but I just went and tested with SF Mono (and a few other monospace fonts) and the result is the same.
EDIT: I also experimented with turning some settings on and off. Turning off readable line lengths helped but haven’t found a complete solution.
I know you said it’s not extra spaces or characters, but have you actually counted all the characters before some of the pipes? (All of them, not just the spaces)
In those two screenshots there’s a single space of difference but the pipe can’t be aligned.
Here’s some of the text I’m using if it helps to debug.
# ZSH aliases
| Shortcut | Description |
| ----------- | --------------------------------------------------------- |
| `..` | Go up a directory |
| `icloud` | Go to iCloud directory |
| `@` | Go to @trevor directory |
| `vault` | Go to Obsidian vault |
| `desk` | Go to Desktop |
PM_Me_Capacitors on Reddit suggested the inline code blocks are a smaller font size than the rest of the text in the table. They’re correct. In source mode, the inline code block is 13.3px and the table text is 15.2px. In reading mode, the inline code block is 14px and the table text is 16px.
I’m not sure why this is happening since I have font size set to 16px. I disabled the Minimal theme so it doesn’t interfere, although the font size setting is also set to 16px.
I can understand having different font sizes when viewing the note in reading mode but having different font sizes in source mode is odd imo.