Custom Containers not rendering #570

Closed
opened 2026-01-29 14:40:01 +00:00 by claunia · 2 comments
Owner

Originally created by @Macadameane on GitHub (Oct 12, 2022).

I recently tried to use this code to generate customer containers. The headers and code fence work without problem. Please let me know if I am doing something wrong:

    var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build();
    string tempDescription = @"
### Header 3
###### Header 6
Plain text

\```
Code fence
\```

:: Custom Span Container ::

:::
Custom Div Container
:::

";
    Description = Markdown.ToHtml(tempDescription);

The value of Description's output is below:

<h3>Header 3</h3>
<h6>Header 6</h6>
<p>Plain text</p>
<pre><code>Code fence
</code></pre>
<p>:: Custom Span Container ::</p>
<p>:::
Custom Div Container
:::</p>

Originally created by @Macadameane on GitHub (Oct 12, 2022). I recently tried to use this code to generate customer containers. The headers and code fence work without problem. Please let me know if I am doing something wrong: ``` var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build(); string tempDescription = @" ### Header 3 ###### Header 6 Plain text \``` Code fence \``` :: Custom Span Container :: ::: Custom Div Container ::: "; Description = Markdown.ToHtml(tempDescription); ``` The value of Description's output is below: ``` <h3>Header 3</h3> <h6>Header 6</h6> <p>Plain text</p> <pre><code>Code fence </code></pre> <p>:: Custom Span Container ::</p> <p>::: Custom Div Container :::</p> ```
Author
Owner

@MihaZupan commented on GitHub (Oct 12, 2022):

-Description = Markdown.ToHtml(tempDescription);
+Description = Markdown.ToHtml(tempDescription, pipeline);

Also note the difference between

:: Custom Span Container ::

and

::Custom Span Container::

See https://github.com/xoofx/markdig/blob/master/src/Markdig.Tests/Specs/CustomContainerSpecs.md#inline-custom-container

@MihaZupan commented on GitHub (Oct 12, 2022): ```diff -Description = Markdown.ToHtml(tempDescription); +Description = Markdown.ToHtml(tempDescription, pipeline); ``` Also note the difference between ``` :: Custom Span Container :: ``` and ``` ::Custom Span Container:: ``` See https://github.com/xoofx/markdig/blob/master/src/Markdig.Tests/Specs/CustomContainerSpecs.md#inline-custom-container
Author
Owner

@Macadameane commented on GitHub (Oct 13, 2022):

-Description = Markdown.ToHtml(tempDescription);
+Description = Markdown.ToHtml(tempDescription, pipeline);

Also note the difference between

:: Custom Span Container ::

and

::Custom Span Container::

See https://github.com/xoofx/markdig/blob/master/src/Markdig.Tests/Specs/CustomContainerSpecs.md#inline-custom-container

Thanks a bunch. I can't believe I forgot the overload. I had tried with and without spaces and all sorts of things.

Thanks again.

@Macadameane commented on GitHub (Oct 13, 2022): > ```diff > -Description = Markdown.ToHtml(tempDescription); > +Description = Markdown.ToHtml(tempDescription, pipeline); > ``` > > Also note the difference between > > ``` > :: Custom Span Container :: > ``` > > and > > ``` > ::Custom Span Container:: > ``` > > See https://github.com/xoofx/markdig/blob/master/src/Markdig.Tests/Specs/CustomContainerSpecs.md#inline-custom-container Thanks a bunch. I can't believe I forgot the overload. I had tried with and without spaces and all sorts of things. Thanks again.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#570