Markdown renderer caused the string in { xxx } lost #257

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

Originally created by @Anduin2017 on GitHub (Dec 28, 2018).

Markdown renderer caused the string in { xxx } lost.

When I try to convert the following markdown to HTML:

{ HTTP_HOST }

Markdig will give me the following result:

<p http_host>
</p>

But it seems other markdown converter will produce the following result:

<p>
  { HTTP_HOST }
</p>

So how to make markdig to remain the content in the braces?

Originally created by @Anduin2017 on GitHub (Dec 28, 2018). Markdown renderer caused the string in { xxx } lost. When I try to convert the following markdown to HTML: ```markdown { HTTP_HOST } ``` Markdig will give me the following result: ```html <p http_host> </p> ``` But it seems other markdown converter will produce the following result: ```html <p> { HTTP_HOST } </p> ``` So how to make markdig to remain the content in the braces?
claunia added the invalid label 2026-01-29 14:31:53 +00:00
Author
Owner

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

Which extensions are enabled? Seems like an edge case caused by a particular extension.

According to https://babelmark.github.io/?text=%7B+HTTP_HOST+%7D, Markdig+extension is the only one to display such behaviour.

@Kryptos-FR commented on GitHub (Dec 28, 2018): Which extensions are enabled? Seems like an edge case caused by a particular extension. According to https://babelmark.github.io/?text=%7B+HTTP_HOST+%7D, Markdig+extension is the only one to display such behaviour.
Author
Owner

@Anduin2017 commented on GitHub (Dec 28, 2018):

My source code is

var pipeline = new MarkdownPipelineBuilder()
                .UseAdvancedExtensions()
                .Build();
// Convert from HTML to markdown
var result = Markdown.ToHtml(mymarkdown, pipeline);

It seems that I am using UseAdvancedExtensions extensions.

@Anduin2017 commented on GitHub (Dec 28, 2018): My source code is ```csharp var pipeline = new MarkdownPipelineBuilder() .UseAdvancedExtensions() .Build(); // Convert from HTML to markdown var result = Markdown.ToHtml(mymarkdown, pipeline); ``` It seems that I am using `UseAdvancedExtensions` extensions.
Author
Owner

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

That's the attribute extension causing this, you should not use it if you are using things like { xxx }

@xoofx commented on GitHub (Dec 28, 2018): That's the attribute extension causing this, you should not use it if you are using things like `{ xxx }`
Author
Owner

@ltm0203 commented on GitHub (Dec 28, 2018):

Changed the code snippet

   var pipeline = new MarkdownPipelineBuilder()
                .UseAutoLinks()
                .UseBootstrap()
                .UseGridTables()
                .UsePipeTables()
                .Build();
            // Convert from HTML to markdown
            var result = Markdown.ToHtml(mymarkdown, pipeline);

@Anduin2017
@xoofx

Thank you very much for solving this problem

@ltm0203 commented on GitHub (Dec 28, 2018): Changed the code snippet ``` var pipeline = new MarkdownPipelineBuilder() .UseAutoLinks() .UseBootstrap() .UseGridTables() .UsePipeTables() .Build(); // Convert from HTML to markdown var result = Markdown.ToHtml(mymarkdown, pipeline); ``` @Anduin2017 @xoofx Thank you very much for solving this problem
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#257