The converted content is incorrect #547

Closed
opened 2026-01-29 14:39:22 +00:00 by claunia · 3 comments
Owner

Originally created by @colindcli on GitHub (Jul 4, 2022).

using System;

public class Program
{
public static void Main()
{
var result = Markdig.Markdown.ToHtml("**This is:**a text with someemphasis");
Console.WriteLine(result); // prints:

This is a text with some emphasis


}
}

err

Originally created by @colindcli on GitHub (Jul 4, 2022). using System; public class Program { public static void Main() { var result = Markdig.Markdown.ToHtml("**This is:**a text with some*emphasis*"); Console.WriteLine(result); // prints: <p>This is a text with some <em>emphasis</em></p> } } ![err](https://user-images.githubusercontent.com/3311217/177124683-fb746b3a-a47f-4155-b854-7890bf4922b5.png)
claunia added the invalid label 2026-01-29 14:39:23 +00:00
Author
Owner

@xoofx commented on GitHub (Jul 4, 2022):

I haven't checked the character before **123, but it is likely considered as a space or unicode punctuation character and so, as stated by the spec, the right ** is not going to be detected as a right flanking delimiter run.

A right-flanking delimiter run is a delimiter run that is (1) not preceded by Unicode whitespace, and either (2a) not preceded by a Unicode punctuation character, or (2b) preceded by a Unicode punctuation character and followed by Unicode whitespace or a Unicode punctuation character.

Almost all CommonMark implementations are reporting the same (only one is showing strong, but I believe it is invalid)

@xoofx commented on GitHub (Jul 4, 2022): I haven't checked the character `:` before `**123`, but it is likely considered as a space or unicode punctuation character and so, as stated by the spec, the right `**` is not going to be detected as a right flanking delimiter run. > A [right-flanking delimiter run](https://spec.commonmark.org/0.30/#right-flanking-delimiter-run) is a [delimiter run](https://spec.commonmark.org/0.30/#delimiter-run) that is (1) not preceded by [Unicode whitespace](https://spec.commonmark.org/0.30/#unicode-whitespace), and either (2a) not preceded by a [Unicode punctuation character](https://spec.commonmark.org/0.30/#unicode-punctuation-character), or (2b) preceded by a [Unicode punctuation character](https://spec.commonmark.org/0.30/#unicode-punctuation-character) and followed by [Unicode whitespace](https://spec.commonmark.org/0.30/#unicode-whitespace) or a [Unicode punctuation character](https://spec.commonmark.org/0.30/#unicode-punctuation-character). Almost all CommonMark implementations are [reporting the same](https://babelmark.github.io/?text=**%E4%B8%AD%E6%96%87%EF%BC%9A**123) (only one is showing strong, but I believe it is invalid)
Author
Owner

@colindcli commented on GitHub (Jul 4, 2022):

.

@colindcli commented on GitHub (Jul 4, 2022): .
Author
Owner

@tats-u commented on GitHub (Nov 13, 2025):

For Chinese text (doesn't work for your example here):

@tats-u commented on GitHub (Nov 13, 2025): For Chinese text (doesn't work for your example here): - #890
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#547