From 747a06daf1b8d7dfe1a0726a7c0fa2e985878d2c Mon Sep 17 00:00:00 2001 From: n Date: Sat, 27 Jan 2024 13:20:53 +0100 Subject: [PATCH] also for Bluesky --- README.md | 3 ++- clickat.meta | 2 +- clickat.php | 7 ++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6b0bc84..5860a67 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # ClickAt [Shaarli](https://github.com/shaarli/Shaarli/) plugin to make microblogging -social networks (Twitter/𝕏, Threads, and Fediverse) addresses clickable. +social networks (Twitter/𝕏, Threads, Bluesky and Fediverse) addresses clickable. ## Manual @@ -10,4 +10,5 @@ social networks (Twitter/𝕏, Threads, and Fediverse) addresses clickable. 3. Quote users from: - Twitter/𝕏 with their `@nic`, - Threads with `@nic@threads.net`, + - Bluesky with `@nic.bsky.social`, - Fediverse with `@nic@instance`. diff --git a/clickat.meta b/clickat.meta index 79eff41..b8413ac 100644 --- a/clickat.meta +++ b/clickat.meta @@ -1 +1 @@ -description="Make microblogging social networks (Twitter/𝕏 and Fediverse) addresses clickable." +description="Make microblogging social networks (Twitter/𝕏, Threads, Bluesky and Fediverse) addresses clickable." diff --git a/clickat.php b/clickat.php index 4643999..d0ebf2e 100644 --- a/clickat.php +++ b/clickat.php @@ -2,7 +2,7 @@ /** * ClickAt * - * This plugin makes microblogging social networks (Twitter/𝕏, Threads and Fediverse) addresses clickable. + * This plugin makes microblogging social networks (Twitter/𝕏, Threads, Bluesky, and Fediverse) addresses clickable. */ use Shaarli\Config\ConfigManager; @@ -13,6 +13,11 @@ function hook_clickat_render_linklist($data) { foreach ($data['links'] as &$value) { + $value['description'] = preg_replace( + '/\ @([\w\d]+).bsky.social/', + ' @\1.bsky.social', + $value['description'] + ); $value['description'] = preg_replace( '/\ @([\w\d]+)@([\w\d_\-\.]+)/', ' @\1',