Commit 95456ac3 authored by Nigel McNie's avatar Nigel McNie
Browse files

A smarter algorithm for putting ellipsis in for longer blog descriptions

parent 6e1bb812
......@@ -121,10 +121,11 @@ class PluginBlocktypeBlogpost extends PluginBlocktype {
$artefact->blog = $blognames[$artefact->parent];
$ellipsis = '';
$artefact->description = trim(strip_tags($artefact->description));
if (strlen($artefact->description) > 100) {
$ellipsis = '…';
}
$artefact->description = substr(trim(strip_tags($artefact->description)), 0, 100) . $ellipsis;
$artefact->description = substr($artefact->description, 0, 100) . $ellipsis;
return $artefact;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment