Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Paste it into a note
Make sure that you’re in live preview mode
Highlight the text and hit tab to make it a code block
Did you follow the troubleshooting guide? [Y/N]
Yes
Expected result
Should appear as a code block like it does in reading mode:
The visual appearance is completely inconsistent with reading mode, and if the text is multiple lines the appearance is very bugged with a vertical line appearing under the text:
SYSTEM INFO:
Obsidian version: v1.8.10
Installer version: v1.8.10
Operating system: Windows 11 Pro 10.0.26100
Login status: logged in
Language: en
Catalyst license: insider
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on
The bug report is marked “repro” and remains open, which means the team reproduced it and considers it a bug. Getting a “thanks” from WhiteNoise is another indication that the team understands what the OP reported.
It’s not preformatted text. It’s a codeblock
It seems the original post called the code blocks “preformatted text” until someone (OP or a mod) edited the title and content to identify it as a “code block”.
I haven’t tried your CSS, but if the two posts get merged, it could increase the chances that folks find your workaround when they come searching.