Compare commits

..

1 Commits

Author SHA1 Message Date
n cdba58fb21
regex fixes
lint / lint (push) Successful in 15s Details
2024-02-25 21:29:47 +01:00
1 changed files with 3 additions and 3 deletions

View File

@ -12,9 +12,9 @@ use Shaarli\Render\TemplatePage;
function hook_clickat_render_linklist($data)
{
$patterns = array(
'/([^\S]+)@([\w]+).bsky.social/' => ' <a href="https://bsky.app/profile/\2.bsky.social">&commat;\2.bsky.social</a>',
'/([^\S]+)@([\w]+)@([\w_\-\.]+)/' => ' <a href="https://\3/@\2">&commat;\2</a>',
'/([^\S]+)@([\w]+)/' => ' <a href="https://twitter.com/\2">&commat;\2</a>'
'/([^\S]+)@([\w]+).bsky.social/' => '\1<a href="https://bsky.app/profile/\2.bsky.social">&commat;\2.bsky.social</a>',
'/([^\S]+)@([\w]+)@([\w_\-\.]+)/' => '\1<a href="https://\3/@\2">&commat;\2</a>',
'/([^\S]+)@([\w]+)/' => '\1<a href="https://twitter.com/\2">&commat;\2</a>'
);
foreach ($data['links'] as &$value) {
if (strpos($value['description'], '@') !== false) {