diff --git a/README.md b/README.md
index e1b41fb..ab84d10 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,3 @@ $ git clone https://forge.tourmentine.com/n/shaarli-plugin-clickat.git path/to/s
- Threads with `@nic@threads.net`,
- Bluesky with `@nic.bsky.social`,
- Fediverse with `@nic@instance`.
-
-## Caveats
-
-For now addresses need to be proceded by an empty space.
diff --git a/clickat.php b/clickat.php
index cd973e6..63aca5f 100644
--- a/clickat.php
+++ b/clickat.php
@@ -12,12 +12,12 @@ use Shaarli\Render\TemplatePage;
function hook_clickat_render_linklist($data)
{
$patterns = array(
- '/\ @([\w\d]+).bsky.social/' => ' @\1.bsky.social',
- '/\ @([\w\d]+)@([\w\d_\-\.]+)/' => ' @\1',
- '/\ @([\w\d]+)/' => ' @\1'
+ '/([^\S]+)@([\w]+).bsky.social/' => '\1@\2.bsky.social',
+ '/([^\S]+)@([\w]+)@([\w_\-\.]+)/' => '\1@\2',
+ '/([^\S]+)@([\w]+)/' => '\1@\2'
);
foreach ($data['links'] as &$value) {
- if (strpos($value['description'], ' @') !== false) {
+ if (strpos($value['description'], '@') !== false) {
foreach($patterns as $nic => $link) {
$value['description'] = preg_replace($nic, $link, $value['description']);
}