Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emojis don't get converted at the start of links #768

Open
Flayms opened this issue Feb 4, 2024 · 1 comment
Open

Emojis don't get converted at the start of links #768

Flayms opened this issue Feb 4, 2024 · 1 comment

Comments

@Flayms
Copy link

Flayms commented Feb 4, 2024

With the following code

using Markdig;

var markdown = "[:clap: a link :clap:](https://github.com/xoofx/markdig)";

var pipeline = new MarkdownPipelineBuilder()
    .UseEmojiAndSmiley()
    .Build();

var html = Markdown.ToHtml(markdown, pipeline);

I am getting the following output:

<p><a href="https://github.com/xoofx/markdig">:clap: a link 👏</a></p>

I believe the first emoji should be converted as well.

@Scooletz
Copy link

This is probably due to:

// Previous char must be a space
if (!slice.PeekCharExtra(-1).IsWhiteSpaceOrZero())
{
return false;
}

The question is whether it's aligned to the spec that requires a space before an emoji https://github.com/xoofx/markdig/blob/master/src/Markdig.Tests/Specs/EmojiSpecs.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants