1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-06-26 04:43:49 +02:00

[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
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.
*