In Live Preview, multi-line HTML code blocks in callouts are not rendered correctly. They do render correctly in Reading view.
Steps to reproduce
- Create a callout
- Create a multi-line HTML code block in the body of the callout
- Toggle between Live Preview and Reading view
The entire code block should be rendered as part of the callout in Live Preview.
In Live Preview, the first line is rendered as part of the callout, but the rest of the code block lines are not.
- Operating system: Windows 10
- Debug info:
Obsidian version: v0.14.5
Installer version: v0.13.24
Operating system: Windows 10 Pro 10.0.19043
Login status: logged in
Catalyst license: supporter
Insider build toggle: on
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: Vileplume
Snippets enabled: 0
Safe mode: off
Plugins installed: 17
Plugins enabled: 15
1: Relative Line Numbers
3: Hotkey Helper
5: Emoji Toolbar
6: Pane Relief
7: Vault Statistics
8: Search Everywhere
9: Quick Explorer
10: Automatically reveal active file
11: Filename Heading Sync
12: Quick Switcher++
13: Core Search Assistant
14: Sliding Panes (Andy’s Mode)
15: Pandoc Plugin
Custom theme: for cosmetic issues, please first try updating your theme to latest. If still not fixed, please try to make the issue happen in the help vault or disable community theme and snippets.
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the help vault or disable community plugins.
We don’t support it. Please, open a feature request.
Chatted with Licat about the issue on Discord.
He and I experimented a bit. The code block in a callout worked until I put HTML markup in it. (And it did render correctly in the Reading view.)
He suggested creating a bug report.
But, I’m happy to create a feature request, if that is the best way to handle it.
which html block did you put exactly?
ah but this is code block that contains html. OK.
I’m experiencing the same issue currently but with C++ imports
Example (taken in live preview, the bug does not exist in reading mode):
I think the issue is with the
> symbol, which obsidian might be interpreting as a new “block quote”?
Same here with the personal Blazor documentation I’m working on.
- I’m not using live preview but the regular editing view (I prefer to have content and rendering in two separate panes), so it’s not just a live preview problem.
- The code block rendering in the edit view breaks at the typed
ILogger, which excludes any nested code block of a language that contains the
> symbols from working in callouts - or block quotes in general.
- The general rendering in the edit view breaks in that note from that point forward (which may point towards this being related to this problem
The vexing part about this is that the callouts work perfectly in the rendered view and are by far the easiest way to achieve collapsible code blocks…
I have the same problem, but it occurs with the Buttons plugin. I’ve added a button to a template. However, when I open the template or create a new note using the template, the button doesn’t show.
I have to click inside and then outside the code block to get the button to display.
After reading the posts in this bug report, I opened the template in reading mode, and there wasn’t any problem.
I’m experiencing the same issue with any multi-line code block inside a callout. I’m using a MacBook M1.