Exemplo n.º 1
0
        /// <summary>
        /// Gets the markup for the emoji.
        /// </summary>
        /// <param name="emoji">The emoji.</param>
        /// <returns>An HTML <c>string</c>.</returns>
        public static string Markup(this GEmoji emoji)
        {
            if (emoji == GEmoji.Empty)
            {
                return(string.Empty);
            }

            return(emoji.IsCustom ?
                   $@"<img class=""emoji"" title="":{emoji.Alias()}:"" alt="":{emoji.Alias()}:"" src=""https://github.githubassets.com/images/icons/emoji/{emoji.Filename}.png"" height=""20"" width=""20"" align=""absmiddle"">" :
                   $@"<g-emoji class=""g-emoji"" alias=""{emoji.Alias()}"" fallback-src=""https://github.githubassets.com/images/icons/emoji/unicode/{emoji.Filename}.png"">{emoji.Raw}</g-emoji>");
        }
Exemplo n.º 2
0
 private static string Alias(this GEmoji emoji)
 {
     return(emoji.Aliases.First());
 }