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..eb9a284 100644 --- a/clickat.php +++ b/clickat.php @@ -12,9 +12,9 @@ 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/' => ' @\2.bsky.social', + '/([^\S]+)@([\w]+)@([\w_\-\.]+)/' => ' @\2', + '/([^\S]+)@([\w]+)/' => ' @\2' ); foreach ($data['links'] as &$value) { if (strpos($value['description'], ' @') !== false) {