Angular brackets ">" will mess live preview of codeblocks in quotes and callouts

Once you’ve done the above, delete everything above this line.

Steps to reproduce

> something...
>
> ```java
> public interface ConverterFactory<S, R> {
>     <T extends R> Converter<S, T> getConverter(Class<T> targetType);
> }
> ```
>
> something...

The bug has nothing to do with third party plugins

Expected result

Actual result

Environment

  • Operating system: windows 11
  • Debug info: SYSTEM INFO:
    Obsidian version: v1.0.3
    Installer version: v0.15.9
    Operating system: Windows 10 Pro 10.0.22623
    Login status: logged in
    Catalyst license: none
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: dark
    Community theme: Minimal
    Snippets enabled: 1
    Restricted mode: off
    Plugins installed: 20
    Plugins enabled: 18
    1: Advanced Tables v0.17.3
    2: Quiet Outline v0.3.6
    3: Minimal Theme Settings v6.1.0
    4: Regex Find/Replace v1.2.0
    5: Better Word Count v0.8.1
    6: Kanban v1.5.1
    7: Emoji Shortcodes v2.1.3
    8: Emoji Toolbar v0.3.2
    9: Calendar v1.5.10
    10: Outliner v4.1.1
    11: Dataview v0.5.47
    12: Homepage v2.4.1
    13: Paste URL into selection v1.7.0
    14: Quick Latex for Obsidian v2.5.1
    15: Pandoc Plugin v0.4.1
    16: Remotely Save v0.3.25
    17: Templater v1.16.0
    18: Style Settings v0.4.12

RECOMMENDATIONS:
Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox 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 Sandbox Vault or disable community plugins.


Additional information

10 Likes

thanks

1 Like

Hope the bug will be quickly handled with

It’s really annoying that it makes the highlight messed up in source mode and invalidates live rendering in live preview mode.

:blush:

Multi-line equations have the same problem.

> Equations:
>
> $$\begin{cases}
> a
> b
> \end{cases}$$
1 Like

Steps to reproduce

  1. open the sandbox vault.
  2. paste the following text
> [!Fabric]-
> [[fabric (py)]] seems relevant, running cmd from python
> ```python
> from fabric import Connection
> result = Connection('web1').run('hostname') # web1
> result  # <Result cmd='hostname' exited=0>
> ```

Expected result

expect the callout to display correctly, without > ''' at the bottom

Actual result

the callout breaks, showing the callout and code > ''' symbols

Environment

  • Operating system: Windows 11
  • Debug info:
SYSTEM INFO:
	Obsidian version: v1.1.9
	Installer version: v1.0.3
	Operating system: Windows 10 Home 10.0.22621
	Login status: logged in
	Catalyst license: none
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on

RECOMMENDATIONS:
	none

Additional information

removing the comment in the code block fixes the callout
# <Result cmd='hostname' exited=0>

in edit mode, the comment is colored as a HTML tag

note this only happens in Live Preview, not reading mode.
related issue: callout-codeblocks-incorrectly-escaped

Steps to reproduce

  1. Enter the following Markdown
> [!Windows] 
>  ```powershell
>  Stop-Process -Name <name-of-process>
>  ```
  1. Move cursor outside of entered markdown.

Expected result

The callout block should be correctly rendered containing a correctly rendered code block. No Markdown should be visible.

Actual result

After moving the cursor anway from the entered Markdown, the callout does display with the code block but the Markdown for closing the codeblock is still visible:
image

Environment

  • Operating system: Windows 11
  • Debug info:
    SYSTEM INFO:
    Obsidian version: v1.1.9
    Installer version: v0.15.9
    Operating system: Windows 10 Pro 10.0.22621
    Login status: not logged in
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: adapt to system
    Community theme: none
    Snippets enabled: 0
    Restricted mode: off
    Plugins installed: 7
    Plugins enabled: 0

RECOMMENDATIONS:
none

Additional information

Incidently, the callout block is renedred as expected in reading mode:
image

Sorry, in repro steps, this should read:

Same issue. Also came here to report this.

I think it’s the angled brackets that mess it up.

I’m also finding that it’s broken parsing of the following markdown as well:

1 Like

I think what’s happening, is that it sees the <name ...> as a html tag, and it’s looking for the close tag. When it then encounters the next quote character it get confused. (I’ve not verified it, but I reckon one could see that in the DOM elements in live preview)

If you change it into <name ... />, the issue disappears. But of course, the callout doesn’t look the same. Variants over this theme related to it being an html tag also can clear the issue.

3 Likes

In Live Preview, multi-line HTML code blocks in callouts are not rendered correctly. They do render correctly in Reading view.

Steps to reproduce

  1. Create a callout
  2. Create a multi-line HTML code block in the body of the callout
  3. Toggle between Live Preview and Reading view

Expected result

The entire code block should be rendered as part of the callout in Live Preview.

Actual result

In Live Preview, the first line is rendered as part of the callout, but the rest of the code block lines are not.

Environment

  • Operating system: Windows 10
  • Debug info:
    SYSTEM 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
    2: Outliner
    3: Hotkey Helper
    4: Dataview
    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

RECOMMENDATIONS:
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.


Additional information

2 Likes

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.

1 Like

which html block did you put exactly?

image

ah but this is code block that contains html. OK.

Correct.

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”?

1 Like

Same here with the personal Blazor documentation I’m working on.

Note that

  1. 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.
  2. 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 < and/or > symbols from working in callouts - or block quotes in general.
  3. 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…

3 Likes

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.

1 Like

I’m experiencing the same issue with any multi-line code block inside a callout. I’m using a MacBook M1.

1 Like