diff --git a/components/status/StatusPreviewCard.vue b/components/status/StatusPreviewCard.vue index 9db9b6d3..d8629d78 100644 --- a/components/status/StatusPreviewCard.vue +++ b/components/status/StatusPreviewCard.vue @@ -23,8 +23,8 @@ const providerName = $computed(() => props.card.providerName ? props.card.provid const gitHubCards = $(useFeatureFlag('experimentalGitHubCards')) -// TODO: regex test the card.title value -const isMastodonLink = true +// checks if title contains a username +const isMastodonLink = props.card.title.match(/@+[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}/gi) // TODO: handle card.type: 'photo' | 'video' | 'rich'; const cardTypeIconMap: Record = {