Question: Having code blocks show in blocks #656

Closed
opened 2026-01-29 14:42:12 +00:00 by claunia · 4 comments
Owner

Originally created by @Pave87 on GitHub (Feb 12, 2024).

So when working with markdown file in VS Studio or Code preview shows code blocks (~~~ and ```) as a block.
But for all I have tried with MarkDig to export this file to html it just very slightly different font and gets lost in other text.

CommonMark.org in their examples shows code block as a fenced block similar to how VS studio and Code show in their previews.

Originally created by @Pave87 on GitHub (Feb 12, 2024). So when working with markdown file in VS Studio or Code preview shows code blocks (~~~ and ```) as a block. But for all I have tried with MarkDig to export this file to html it just very slightly different font and gets lost in other text. CommonMark.org in their examples shows code block as a fenced block similar to how VS studio and Code show in their previews.
claunia added the questioninvalid labels 2026-01-29 14:42:12 +00:00
Author
Owner

@xoofx commented on GitHub (Feb 13, 2024):

So when working with markdown file in VS Studio or Code preview shows code blocks (~~~ and ```) as a block.

Please post the exact problem you are encountering with a proof of work/not work on https://babelmark.github.io/

@xoofx commented on GitHub (Feb 13, 2024): > So when working with markdown file in VS Studio or Code preview shows code blocks (~~~ and ```) as a block. Please post the exact problem you are encountering with a proof of work/not work on https://babelmark.github.io/
Author
Owner

@Pave87 commented on GitHub (Feb 14, 2024):

When I enter sample from my file there is prints out as expected.

But file that I get when running in my C# project prints out code differently.
Code:

var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build();
var result = Markdown.ToHtml(File.ReadAllText("doc.md"), pipeline);
File.WriteAllText("doc.html", result.ToString());

image

@Pave87 commented on GitHub (Feb 14, 2024): When I enter [sample ](https://babelmark.github.io/?text=You+can+also+use+Scanner+specific+defaults.%0A~~~%0A%3CAddMissingValues+%3E%0A++++%3CCustomer%3ESampleCustomer%3C%2FCustomer%3E%0A++++%3CProduct%3ESampleProduct%3C%2FProduct%3E%0A%3C%2FAddMissingValues%3E%0A~~~)from my file there is prints out as expected. But file that I get when running in my C# project prints out code differently. Code: ``` var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build(); var result = Markdown.ToHtml(File.ReadAllText("doc.md"), pipeline); File.WriteAllText("doc.html", result.ToString()); ``` ![image](https://github.com/xoofx/markdig/assets/61083765/1dc63828-08a9-429a-b778-73a2515100b6)
Author
Owner

@xoofx commented on GitHub (Feb 17, 2024):

I'm going to update the markdig on babelmark as the version is a bit old and will double check your case.

@xoofx commented on GitHub (Feb 17, 2024): I'm going to update the markdig on babelmark as the version is a bit old and will double check your case.
Author
Owner

@xoofx commented on GitHub (Feb 18, 2024):

The markdown you posted above:

You can also use Scanner specific defaults.
~~~
<AddMissingValues >
    <Customer>SampleCustomer</Customer>
    <Product>SampleProduct</Product>
</AddMissingValues>
~~~

Outputs the following with Markdig:

<p>You can also use Scanner specific defaults.</p>
<pre><code>&lt;AddMissingValues &gt;
    &lt;Customer&gt;SampleCustomer&lt;/Customer&gt;
    &lt;Product&gt;SampleProduct&lt;/Product&gt;
&lt;/AddMissingValues&gt;
</code></pre>

Which is correct, so I'm not sure what are you expecting, but I don't think there ia an issue with Markdig here.

@xoofx commented on GitHub (Feb 18, 2024): The markdown you posted above: ```md You can also use Scanner specific defaults. ~~~ <AddMissingValues > <Customer>SampleCustomer</Customer> <Product>SampleProduct</Product> </AddMissingValues> ~~~ ``` Outputs the following with Markdig: ```html <p>You can also use Scanner specific defaults.</p> <pre><code>&lt;AddMissingValues &gt; &lt;Customer&gt;SampleCustomer&lt;/Customer&gt; &lt;Product&gt;SampleProduct&lt;/Product&gt; &lt;/AddMissingValues&gt; </code></pre> ``` Which is correct, so I'm not sure what are you expecting, but I don't think there ia an issue with Markdig here.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#656