diff --git a/packages/frontend/src/pages/search.user.vue b/packages/frontend/src/pages/search.user.vue index d9853e7700..596f4da711 100644 --- a/packages/frontend/src/pages/search.user.vue +++ b/packages/frontend/src/pages/search.user.vue @@ -65,6 +65,11 @@ async function search() { return; } + if (query.match(/^@[a-z0-9_.-]+@[a-z0-9_.-]+$/i)) { + router.push(`/${query}`); + return; + } + userPagination.value = { endpoint: 'users/search', limit: 10, diff --git a/packages/frontend/src/widgets/WidgetSearch.vue b/packages/frontend/src/widgets/WidgetSearch.vue index c114707b23..9999139776 100644 --- a/packages/frontend/src/widgets/WidgetSearch.vue +++ b/packages/frontend/src/widgets/WidgetSearch.vue @@ -117,6 +117,16 @@ async function search() { return; } + if (query.match(/^@[a-z0-9_.-]+@[a-z0-9_.-]+$/i)) { + router.push(`/${query}`); + return; + } + + if (query.startsWith('#')) { + router.push(`/tags/${encodeURIComponent(query.substring(1))}`); + return; + } + notePagination.value = { endpoint: 'notes/search', limit: 10,