cafeyn improve dropcap

This commit is contained in:
quenousimporte 2024-08-30 11:33:59 +02:00
parent a2bdf984fc
commit 64cc817bc9
1 changed files with 11 additions and 1 deletions

View File

@ -225,6 +225,7 @@
foreach ($article->content->sections as $section)
{
$dropcap = '';
foreach ($section->items as $item)
{
if ($item->type == 'text')
@ -241,9 +242,18 @@
{
$content .= '<p><b>' .$item->content . '</b></p>';
}
else if ($item->class == 'dropcap')
{
$dropcap = $item->content;
}
else
{
$content .= '<p>' .$item->content . '</p>';
if ($dropcap)
{
$item->content = '<b>' . $dropcap . '</b>' . $item->content;
$dropcap = '';
}
$content .= '<p>' . $item->content . '</p>';
}
}
}