xoofx / xoofx/markdig

Strikethrough (~~) renders as empty angle brackets

Open
#709 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
C#
Stars
5.3k
Forks
510
Avg merge
8d 5h
Merged PRs (30d)
5

Description

I have a situation that I have worked around that seems like it might be a bug, but I acknowledge that this might be by design and that I have just misunderstood something.

I have this markdown in a variable named markdown:

To do:

~~add PDF link to board~~

I have added the emphasis extras and was having an issue. (I have tried both with and without EmphasisExtraOptions.Strikethrough.)

var pipeline = new MarkdownPipelineBuilder()
    .UseEmphasisExtras()
    .Build();
var doc = Markdown.Parse(markdown, pipeline);
var html = doc.ToHtml();

// I learned that it works if I pass the pipeline again to ToHtml in addition to passing to Parse above
// var html = doc.ToHtml(pipeline); 

The following is the generated HTML:

<p>To do:</p>
<p><>add PDF link to board</></p>

I have also tested with ~, +, ^, and all give the same result with empty tags.

I am using:

  • version 0.31.0
  • ASP.NET 6
  • Visual Studio 2022

All that said, if I pass the pipeline again to the ToHtml call, it does render the tags correctly. I would have thought that since I created doc with the pipeline that I wouldn't need to use it again when calling ToHtml.

Is this a bug, or by design? Any suggestions what I am missing?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Markdown.Parse and doc.ToHtml calls shown in the issue, comparing how the pipeline is retained and used by each operation. Reproduce the sample with UseEmphasisExtras and verify the expected strikethrough HTML; done means the parsed document renders correctly without passing the pipeline again to ToHtml.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.