Callout codeblocks incorrectly escaped with ">"

Things I have tried

What I’m trying to do

I wanted to insert html code (or any code containing >) into a callout.

But the > seems to escape the callout block and subsequent lines are not rendered as expected.

Here an example:

> [!example] Code Example
>```html
> <body>
>     <h1>HTML First Program</h1>
>     <p>HTML Hello World.</p>
> </body>
>```

is expected to be rendered as:

but is instead rendered as:

  • the h1 and the following lines are plain text and not inside the callout

One way to avoid this issue, is to insert a \ before the first > before a block:

But it means that I can’t copy code as conveniently as before and have to always remove the \.

Am I doing something wrong? How should I insert code into a callout correctly?

Note: There is a workaround using the admonition plugin, but I’d rather use callouts instead. Here the workaround for the code above that renders as expected:

```ad-example
~~~html
<body>
    <h1>HTML First Program</h1>
    <p>HTML Hello World.</p>
</body>
~~~

Well, Live preview (LP) isn’t the best view to render things. If you try the Reading view, maybe things work as expected.

2 Likes

oh yes you are right, it renders as expected. Thank you!

The problem was that I was using live preview

I was not aware that there were such differences between Live preview and Reading view

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.