mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-22 05:57:30 +00:00
[HTML] Recognize standard emoji by code and show emoji code in tooltips
Closes #549 Closes #599
This commit is contained in:
8850
DiscordChatExporter.Core/Utils/EmojiIndex.cs
Normal file
8850
DiscordChatExporter.Core/Utils/EmojiIndex.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user