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) foreach ($article->content->sections as $section)
{ {
$dropcap = '';
foreach ($section->items as $item) foreach ($section->items as $item)
{ {
if ($item->type == 'text') if ($item->type == 'text')
@ -241,8 +242,17 @@
{ {
$content .= '<p><b>' .$item->content . '</b></p>'; $content .= '<p><b>' .$item->content . '</b></p>';
} }
else if ($item->class == 'dropcap')
{
$dropcap = $item->content;
}
else else
{ {
if ($dropcap)
{
$item->content = '<b>' . $dropcap . '</b>' . $item->content;
$dropcap = '';
}
$content .= '<p>' . $item->content . '</p>'; $content .= '<p>' . $item->content . '</p>';
} }
} }