Possible fix for the grid breaking emojis. Trying again with Keno

This commit is contained in:
barelyprofessional
2026-05-10 22:41:33 -05:00
parent 1ee91e3f6c
commit 9fd1124522
2 changed files with 9 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
using System.Text;
using System.Globalization;
using System.Text;
using System.Text.RegularExpressions;
using KfChatDotNetBot.Models.DbModels;
@@ -149,7 +150,11 @@ public static class Extensions
foreach (var row in s.Split(["[br]", "[BR]", "\n"], StringSplitOptions.None))
{
table += "[tr]";
table = row.ToCharArray().Aggregate(table, (current, glyph) => current + $"[td]{glyph}[/td]");
var enumerator = StringInfo.GetTextElementEnumerator(row);
while (enumerator.MoveNext())
{
table += $"[td]{enumerator.Current}[/td]";
}
table += "[/tr]";
}