fix: Support compound emojis in mood parsing

- Updated regex to handle compound emojis with zero-width joiners (ZWJ)
- Fixes mood display for emojis like 😶‍🌫️ (face in clouds)
- Now captures full emoji sequences including variation selectors
This commit is contained in:
Spicy_Marinara
2025-10-14 11:39:32 +02:00
parent a9b0b6fefe
commit d5e4010d4d
2 changed files with 43 additions and 82 deletions
+3 -2
View File
@@ -1510,8 +1510,9 @@ function parseUserStats(statsText) {
const arousalMatch = statsText.match(/Arousal:\s*(\d+)%/);
// Match new format: [Emoji]: [Conditions]
// Look for emoji followed by colon, then conditions
const moodMatch = statsText.match(/(\p{Emoji}):\s*(.+)/u);
// Look for emoji (including compound emojis with ZWJ) followed by colon, then conditions
// Using [\p{Emoji}\u200D]+ to capture compound emojis with zero-width joiners
const moodMatch = statsText.match(/([\p{Emoji}\uFE0F\u200D]+):\s*(.+)/u);
// Extract inventory
const inventoryMatch = statsText.match(/Inventory:\s*(.+)/i);