From b5a1f13d7c67921359571333ea02d79f1e0383ad Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 5 Jun 2023 04:31:19 +0000 Subject: [PATCH] New BBCode constant for Bluesky --- src/Content/Text/BBCode.php | 3 ++- src/Content/Text/Plaintext.php | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 0e5ee9d4e..e321b13e7 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -62,6 +62,7 @@ class BBCode const TWITTER = 8; const BACKLINK = 8; const ACTIVITYPUB = 9; + const BLUESKY = 10; const TOP_ANCHOR = '
'; const BOTTOM_ANCHOR = '
'; @@ -1771,7 +1772,7 @@ class BBCode $text ); - if (in_array($simple_html, [self::OSTATUS, self::TWITTER])) { + if (in_array($simple_html, [self::OSTATUS, self::TWITTER, self::BLUESKY])) { $text = preg_replace_callback("/([^#@!])\[url\=([^\]]*)\](.*?)\[\/url\]/ism", [self::class, 'expandLinksCallback'], $text); //$text = preg_replace("/[^#@!]\[url\=([^\]]*)\](.*?)\[\/url\]/ism", ' $2 [url]$1[/url]', $text); $text = preg_replace("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism", ' $2 [url]$1[/url]', $text); diff --git a/src/Content/Text/Plaintext.php b/src/Content/Text/Plaintext.php index b297f75b3..86d720a02 100644 --- a/src/Content/Text/Plaintext.php +++ b/src/Content/Text/Plaintext.php @@ -137,6 +137,10 @@ class Plaintext $abstract = BBCode::getAbstract($item['body'], Protocol::STATUSNET); break; + case BBCode::BLUESKY: + $abstract = BBCode::getAbstract($item['body'], Protocol::BLUESKY); + break; + default: // We don't know the exact target. // We fetch an abstract since there is a posting limit. if ($limit > 0) {