<![CDATA[ breaks code blocks #247

Closed
opened 2026-01-29 14:31:35 +00:00 by claunia · 5 comments
Owner

Originally created by @clarkd on GitHub (Dec 11, 2018).

Using some CDATA blocks within a code sample seems to break Markdig. The rest of the markdown document does not render in our case.

e.g. trying to render the following markdown:

   # This is a test
   ```xml
   <failure><![CDATA[this is part 1 )]]></failure>
   <step><![CDATA[this is part 2]]></step>
   ```

Results in the following - as you can see, the second part is not rendered.

image

Any ideas? Is this a known issue?

Originally created by @clarkd on GitHub (Dec 11, 2018). Using some CDATA blocks within a code sample seems to break Markdig. The rest of the markdown document does not render in our case. e.g. trying to render the following markdown: ```` # This is a test ```xml <failure><![CDATA[this is part 1 )]]></failure> <step><![CDATA[this is part 2]]></step> ``` ```` Results in the following - as you can see, the second part is not rendered. ![image](https://user-images.githubusercontent.com/3793131/49792454-b14f0600-fd2a-11e8-8866-3c91b4a5e783.png) Any ideas? Is this a known issue?
claunia added the invalid label 2026-01-29 14:31:35 +00:00
Author
Owner

@MihaZupan commented on GitHub (Dec 11, 2018):

I can't reproduce this myself, are you using any custom extensions for the test?
Babelmark

@MihaZupan commented on GitHub (Dec 11, 2018): I can't reproduce this myself, are you using any custom extensions for the test? [Babelmark](https://bit.ly/2SJFyU1)
Author
Owner

@clarkd commented on GitHub (Dec 11, 2018):

Thanks for the quick reply.

Our pipeline looks like this:

        return new MarkdownPipelineBuilder()
        .UseAdvancedExtensions()
        .UseEmojiAndSmiley()
        .UseBootstrap()
        .UseJiraLinks(new JiraLinkOptions("https://xxxxx.atlassian.net"))
        .Build();
@clarkd commented on GitHub (Dec 11, 2018): Thanks for the quick reply. Our pipeline looks like this: ``` return new MarkdownPipelineBuilder() .UseAdvancedExtensions() .UseEmojiAndSmiley() .UseBootstrap() .UseJiraLinks(new JiraLinkOptions("https://xxxxx.atlassian.net")) .Build(); ```
Author
Owner

@MihaZupan commented on GitHub (Dec 11, 2018):

I get the following html with these as well:

<h1 id="this-is-a-test">This is a test</h1>
<pre><code class="language-xml">&lt;failure&gt;&lt;![CDATA[this is part 1 )]]&gt;&lt;/failure&gt;
&lt;step&gt;&lt;![CDATA[this is part 2]]&gt;&lt;/step&gt;
</code></pre>
@MihaZupan commented on GitHub (Dec 11, 2018): I get the following html with these as well: ```html <h1 id="this-is-a-test">This is a test</h1> <pre><code class="language-xml">&lt;failure&gt;&lt;![CDATA[this is part 1 )]]&gt;&lt;/failure&gt; &lt;step&gt;&lt;![CDATA[this is part 2]]&gt;&lt;/step&gt; </code></pre> ```
Author
Owner

@Kryptos-FR commented on GitHub (Dec 11, 2018):

Looks like you are applying a style (I can even see a scrollbar in your caption). Might need to have a look at your CSS (or else), but as @MihaZupan mentioned, the generated HTML looks fine.

@Kryptos-FR commented on GitHub (Dec 11, 2018): Looks like you are applying a style (I can even see a scrollbar in your caption). Might need to have a look at your CSS (or else), but as @MihaZupan mentioned, the generated HTML looks fine.
Author
Owner

@xoofx commented on GitHub (Dec 11, 2018):

@clarkd could you post the generated HTML? It is unlikely a problem in markdig (see babelmark), so as suggested, it might just be the syntax coloring extension messing with generated output?

@xoofx commented on GitHub (Dec 11, 2018): @clarkd could you post the generated HTML? It is unlikely a problem in markdig (see babelmark), so as suggested, it might just be the syntax coloring extension messing with generated output?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#247