-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Support for GitHub markdown emojis #448
Comments
@KirkMunro Although I see your point, what's the downside of getting that functionality through an extension? github wayAs far as I can tell, github uses HTML5 custom elements for emojis: :bulb: IDEA: Since showdownjs has native GFM support, complete it by adding GFM emoji support to showdownjs! <p><g-emoji alias="bulb" fallback-src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f4a1.png" ios-version="6.0">💡</g-emoji> IDEA: Since showdownjs has native GFM support, complete it by adding GFM emoji support to showdownjs!</p> which won't work for showdown since it would end up generating non compliant HTML5. Showdown waySo, if this feature is implemented, we would only replace :bulb: IDEA: Since showdownjs has native GFM support, complete it by adding GFM emoji support to showdownjs! <p>💡 IDEA: Since showdownjs has native GFM support, complete it by adding GFM emoji support to showdownjs!</p> ProblemThere are also a few github "non standard" emojis that have no unicode correspondence. Ex: |
Feature implemented in 5b8f1d3 and should be released @ v1.8.0.
If you like our work and find our library useful, please donate through Pledgie or directly through paypal!! Your contribution will be greatly appreciated. |
Wow, that was fast. Thanks @tivie! |
Is it worth noting that this has a relatively large impact on the size of the library? The minimised version grows from around 40kB to 95kB (or 11kB to 32kB after gzipping). It's not hard to strip this out if you're not interested in emoji-support and want to save the 20-40kB: .replace(/showdown.helper.emojis = \{[\s\S]+?\};/, 'showdown.helper.emojis = {};'); works for me in a grunt-task, for example. I bring it up only because it might surprise some people using Showdown client-side who find their javascript bundles growing by perhaps 10% or so, and one of Showdown's attractions has been that it's fairly slim. |
Looks as though much of the increase (particularly post-gzip?) might be the special :showdown: 'emoji'. It might be possible to slim that down quite a bit by optimising the PNG. |
Yeah, the culprits are showdown and octocat emojis. |
GitHub markdown emojis are not supported in showdownjs.
For example:
💡 IDEA: Since showdownjs has native GFM support, complete it by adding GFM emoji support to showdownjs!
Please consider adding this natively. I know there is an extension out there, but since GFM is supported natively this really should be there natively too.
The text was updated successfully, but these errors were encountered: