diff --git a/README.md b/README.md index d975af8..de25cd0 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ # ClickAt -[Shaarli](https://github.com/shaarli/Shaarli/) plugin to make 𝕏 and Fediverse addresses clickable. +[Shaarli](https://github.com/shaarli/Shaarli/) plugin to make microblogging +social networks (Twitter/𝕏 and Fediverse) addresses clickable. ## Manual 1. Clone repository in plugin directory. 2. Activate plugin. -3. Quote users from Twitter/𝕏 with their `@nic`, and users from the Fediverse with `@nic@server`. +3. Quote users from: + - Twitter/𝕏 with their `@nic`, + - Fediverse with `@nic@instance`. diff --git a/clickat.meta b/clickat.meta index 3bc366f..79eff41 100644 --- a/clickat.meta +++ b/clickat.meta @@ -1 +1 @@ -description="Make Twitter and Fediverse addresses clickable." +description="Make microblogging social networks (Twitter/𝕏 and Fediverse) addresses clickable." diff --git a/clickat.php b/clickat.php index 4639caf..7f98faf 100644 --- a/clickat.php +++ b/clickat.php @@ -2,7 +2,7 @@ /** * ClickAt * - * This plugin makes Twitter and Fediverse addresses clickable. + * This plugin makes microblogging social networks (Twitter/𝕏 and Fediverse) addresses clickable. */ use Shaarli\Config\ConfigManager; @@ -13,8 +13,16 @@ function hook_clickat_render_linklist($data) { foreach ($data['links'] as &$value) { - $value['description'] = preg_replace('/\ @([\w\d]+)@([\w\d_\-\.]+)/',' @\1',$value['description']); - $value['description'] = preg_replace('/\ @([\w\d]+)/',' @\1',$value['description']); + $value['description'] = preg_replace( + '/\ @([\w\d]+)@([\w\d_\-\.]+)/', + ' @\1', + $value['description'] + ); + $value['description'] = preg_replace( + '/\ @([\w\d]+)/', + ' @\1', + $value['description'] + ); } return $data; }