Skip to content

Fix emoji not rendering in table cells#928

Merged
xoofx merged 3 commits intoxoofx:mainfrom
prozolic:fix
Mar 4, 2026
Merged

Fix emoji not rendering in table cells#928
xoofx merged 3 commits intoxoofx:mainfrom
prozolic:fix

Conversation

@prozolic
Copy link
Copy Markdown
Contributor

@prozolic prozolic commented Mar 4, 2026

This PR added char.IsLetterOrDigit to the character check in EmojiParser.Match.
It enables rendering for emoji patterns like |:x:|.
#807

Copilot AI review requested due to automatic review settings March 4, 2026 14:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Emoji extension’s inline matching rules so emoji shortcodes can render inside pipe table cells (e.g., |:x:|), addressing #807.

Changes:

  • Relaxed the “previous character” boundary check in EmojiParser.Match to allow emoji matches after non-alphanumeric characters.
  • Added NUnit regression tests covering emoji rendering in pipe tables and non-matching cases when preceded by letters/digits.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Markdig/Extensions/Emoji/EmojiParser.cs Expands emoji boundary conditions to allow parsing after non-letter/digit characters (e.g., table cell `
src/Markdig.Tests/TestCustomEmojis.cs Adds regression tests for emoji rendering behavior within pipe tables.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/Markdig/Extensions/Emoji/EmojiParser.cs
Comment thread src/Markdig/Extensions/Emoji/EmojiParser.cs Outdated
prozolic and others added 2 commits March 4, 2026 23:46
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@xoofx xoofx added the bug label Mar 4, 2026
@xoofx xoofx merged commit 7cb7583 into xoofx:main Mar 4, 2026
3 checks passed
@xoofx
Copy link
Copy Markdown
Owner

xoofx commented Mar 4, 2026

Good catch! Indeed, this is something that should be fixed, thank you!

@prozolic prozolic deleted the fix branch March 4, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants