markdig icon indicating copy to clipboard operation
markdig copied to clipboard

Why is the hyperlink & automatically encoded as &

Open colindcli opened this issue 1 year ago • 2 comments

var pipeline = new MarkdownPipelineBuilder().Build();
var md = @"[link](https://pan.test.com/s/?pwd=93d3&path=%2Fv%2Ffid)";
var doc = Markdown.Parse(md, pipeline);
var html = doc.ToHtml(pipeline);  //<p><a href="https://pan.test.com/s/?pwd=93d3&amp;path=%2Fv%2Ffid">link</a></p>

Output hyperlinks & automatically encode as &

colindcli avatar Jul 04 '24 10:07 colindcli

I don't remember that it was clearly specified in the specs (left to the implementation), and babelmark indicates that most CommonMark implementation are escaping here

It has been the behavior for more than 6 years now, so I don't think it is a problem.

xoofx avatar Jul 13 '24 12:07 xoofx

Indeed, this problem is not a big one. It would be better if you can keep the link as it is, or make a configuration. Thank you!

colindcli avatar Jul 13 '24 15:07 colindcli