[HTML] Recognize standard emoji by code and show emoji code in tooltips

Closes #549
Closes #599
This commit is contained in:
Tyrrrz
2021-06-19 19:49:53 +03:00
parent de57cd714d
commit 24a80f915f
14 changed files with 8960 additions and 77 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,5 @@
using System.Text;
using System.Collections.Generic;
using System.Text;
namespace DiscordChatExporter.Core.Utils.Extensions
{
@@ -14,6 +15,16 @@ namespace DiscordChatExporter.Core.Utils.Extensions
? str[..charCount]
: str;
public static IEnumerable<Rune> GetRunes(this string str)
{
var lastIndex = 0;
while (lastIndex < str.Length && Rune.TryGetRuneAt(str, lastIndex, out var rune))
{
yield return rune;
lastIndex += rune.Utf16SequenceLength;
}
}
public static StringBuilder AppendIfNotEmpty(this StringBuilder builder, char value) =>
builder.Length > 0
? builder.Append(value)