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

feat: Enable smileys in "emojis and smileys extension" #9772

Closed
wants to merge 2 commits into from

Conversation

EMaderbacher
Copy link
Contributor

Enable smileys in "emojis and smileys extension"

@EMaderbacher
Copy link
Contributor Author

@dotnet-policy-service agree

@EMaderbacher
Copy link
Contributor Author

Updated unit tests too because :* will result in 😗
I'm not sure whether you'll classify this as breaking change...

Copy link

codecov bot commented Mar 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.00%. Comparing base (fe673ec) to head (e48e833).
Report is 64 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9772      +/-   ##
==========================================
+ Coverage   74.31%   79.00%   +4.68%     
==========================================
  Files         536      536              
  Lines       23189    23185       -4     
  Branches     4056     4025      -31     
==========================================
+ Hits        17234    18317    +1083     
+ Misses       4853     3746    -1107     
- Partials     1102     1122      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@filzrev
Copy link
Contributor

filzrev commented Mar 11, 2024

Updated unit tests too because :* will result in 😗
I'm not sure whether you'll classify this as breaking change...

When setting enableSmileys=true, following text are additionally replaced to emoji.

https://github.com/xoofx/markdig/blob/fcb56fb03701cc1a07a52769908579adb8927ee2/src/Markdig/Extensions/Emoji/EmojiMapping.cs#L1651-L1729

It it's set by default. Existing document might be affected.
I thought it' better this setting as opt-in features. (And #9762 EmphasisExtras features also)
By explicitly setting following configs.

"build": {
    "markdownEngineProperties": {
      "markdigExtensions": [
          "EmphasisExtras",
          "Emojis"
      ]
    }
  }

Currently above config is not works.
Because optional extension is skipped when same extension type is already registered.
I'll try to fix this problem at another PR.

@EMaderbacher
Copy link
Contributor Author

Will moving builder.UseOptionalExtensions(extensions); before builder.UseDocfxExtensions(... (in MarkdigMarkdownService) have any negative impact?

@filzrev
Copy link
Contributor

filzrev commented Mar 11, 2024

Will moving builder.UseOptionalExtensions(extensions); before builder.UseDocfxExtensions(... (in MarkdigMarkdownService) have any negative impact?

Some markdig extensions seems to have specific order dependencies.
It need to preserve extension orders as possible.

I've created PR #9780 to override existing markdig extension with default settings.

@yufeih
Copy link
Contributor

yufeih commented Mar 12, 2024

Thank you @filzrev for pointing out and yes this is a breaking change and needs opt-in. Closing in favor of #9780

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

Successfully merging this pull request may close these issues.

3 participants