Skip to content

Span-level markdown re-rendered within customblocks #8

@GiovanH

Description

@GiovanH

I'm seeing inconsistent behavior between CB and hand-written HTML, and it's preventing me from rendering <pre> blocks correctly.

Minimal example:

from customblocks.utils import Markdown as cbMarkdown
from customblocks.utils import E as cbE

def cb_pre(ctx, *args, **kwargs):
    return cbE(
        f"pre",
        ctx.content
    )

(Note this is not using cbMarkdown, which does re-render block elements if I substitute it for ctx.content.)

Input markdown:

<pre>
*Don't render me as italic*

- I don't have a markdown list either
</pre>

::: pre
    *Don't render me as italic*

    - I don't have a markdown list either

Output HTML:

<pre>*Don't render me as italic*

- I don't have a markdown list either
</pre>
<pre><em>Don’t render me as italic</em>

- I don’t have a markdown list either
</pre>

Note how the list is not rendered in either case, and the customblock is not wrapped in a <p> block element, but the italics are rendered.

Expected output HTML:

<pre>*Don't render me as italic*

- I don't have a markdown list either
</pre>
<pre>*Don't render me as italic*

- I don't have a markdown list either
</pre>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions