Example #1
0
 public static string ConvertEmojis(this string markdown, Block ast)
 {
     return(Scan.Replace(markdown, match =>
     {
         if (!AbstractSyntaxTree.PositionSafeForSmartLink(ast, match.Index, match.Length))
         {
             return match.Value;
         }
         string value;
         return Emojis.TryGetValue(match.Value, out value)
             ? $"<i class=\"_sprite {value}\"/>"
             : match.Value;
     }));
 }