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:
Claude
2026-01-09 09:56:02 +00:00
parent a1fe411161
commit aef464b8a0
2 changed files with 2 additions and 2 deletions

View File

@@ -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,

View File

@@ -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,