markdig icon indicating copy to clipboard operation
markdig copied to clipboard

Weird format when nesting custom containers.

Open pauldotknopf opened this issue 7 years ago • 3 comments

I'm trying to create some utility classes for use in my markdown.

Give this:

:::section-columns

:::section-column

column 1

:::

:::section-column

column 2

:::

:::

I get this:

<div class="section-columns">
    <div class="section-column">
        <p>column 1</p>
    </div>
</div>
<div class="section-column">
    <p>column 2</p>
</div>
<div>
</div>

I expected (wrongly?) this:

<div class="section-columns">
    <div class="section-column">
        <p>column 1</p>
    </div>
    <div class="section-column">
        <p>column 2</p>
    </div>
</div>

pauldotknopf avatar Jun 24 '18 13:06 pauldotknopf

Hmm, sorry, I see another issue here with the same issue: #202

I think it comes down to the number of :'s used. Let me try that real quick.

pauldotknopf avatar Jun 24 '18 14:06 pauldotknopf

Yup, this works:

::::section-columns

:::section-column

column 1

:::

:::section-column

column 2

:::

::::

Any ideas why that is required? Pandoc seems to handle it (correctly?).

pauldotknopf avatar Jun 24 '18 14:06 pauldotknopf

Yes, it was mainly by design/implementation practicability (reusing an existing component to perform the parsing) but if Pandoc is actually not doing that, we can adopt a similar behavior. It may require a dedicated parser through. PR Welcome (don't have spare time for this!)

xoofx avatar Jul 10 '18 08:07 xoofx