mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-10 07:27:23 +02:00
Fix custom emoji shortcode matching to include dashes
The regex pattern for matching NIP-30 custom emoji shortcodes was missing the dash character, causing emojis like :work-out: to fail matching. Updated both ReactionRenderer and ReactionCompactPreview to use [a-zA-Z0-9_-] instead of [a-zA-Z0-9_].
This commit is contained in:
@@ -26,7 +26,7 @@ export function ReactionCompactPreview({ event }: { event: NostrEvent }) {
|
||||
|
||||
// Parse reaction content for custom emoji
|
||||
const parsedReaction = useMemo(() => {
|
||||
const match = reaction.match(/^:([a-zA-Z0-9_]+):$/);
|
||||
const match = reaction.match(/^:([a-zA-Z0-9_-]+):$/);
|
||||
if (match && customEmojis[match[1]]) {
|
||||
return {
|
||||
type: "custom" as const,
|
||||
|
||||
@@ -32,7 +32,7 @@ export function Kind7Renderer({ event }: BaseEventProps) {
|
||||
// Parse reaction content to detect custom emoji shortcodes
|
||||
// Format: :shortcode: in the content
|
||||
const parsedReaction = useMemo(() => {
|
||||
const match = reaction.match(/^:([a-zA-Z0-9_]+):$/);
|
||||
const match = reaction.match(/^:([a-zA-Z0-9_-]+):$/);
|
||||
if (match && customEmojis[match[1]]) {
|
||||
return {
|
||||
type: "custom" as const,
|
||||
|
||||
Reference in New Issue
Block a user