GitHub Emoji for ASP.NET Core
The package includes:
- TagHelpers
- HtmlHelpers
Update the _ViewImports.cshtml
file, to enable tag helpers in all Razor views:
@addTagHelper *, GEmojiSharp.AspNetCore
Use the <emoji>
tag or emoji
attribute to render emojis:
<span emoji=":tada:"></span>
<emoji>:tada: initial commit</emoji>
Do you want to use emoji anywhere, on any tag, in the body
? Then you can use the BodyTagHelperComponent
.
Registration via services container:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorPages();
builder.Services.AddTransient<ITagHelperComponent, BodyTagHelperComponent>();
Use any tag to render emojis:
<h1>Hello, :earth_africa:</h1>
Update the _ViewImports.cshtml
file, to enable HTML helpers in all Razor views:
@using GEmojiSharp.AspNetCore
Use the Emoji
extension methods to render emojis:
@Html.Emoji(":tada: initial commit")
@Html.Emoji(x => x.Text)
Further documentation is available at https://github.com/hlaueriksson/GEmojiSharp