[Gab] feat: add new bridge GabBridge (#2920)

This commit is contained in:
Dag 2022-07-31 03:52:27 +02:00 committed by GitHub
parent 5b5f3b4254
commit 0a060b2ad6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 86 additions and 1 deletions

View file

@ -50,6 +50,15 @@ function raw(string $s): string
return $s;
}
function truncate(string $s, int $length = 150, $marker = '...'): string
{
$s = trim($s);
if (mb_strlen($s) <= $length) {
return $s;
}
return mb_substr($s, 0, $length) . $marker;
}
/**
* Removes unwanted tags from a given HTML text.
*