From 64cc817bc9fa57e8a86a31c52be197d143e6bc5c Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Fri, 30 Aug 2024 11:33:59 +0200 Subject: [PATCH] cafeyn improve dropcap --- epub.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/epub.php b/epub.php index a7153eb..dae0171 100644 --- a/epub.php +++ b/epub.php @@ -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 .= '

' .$item->content . '

'; } + else if ($item->class == 'dropcap') + { + $dropcap = $item->content; + } else { - $content .= '

' .$item->content . '

'; + if ($dropcap) + { + $item->content = '' . $dropcap . '' . $item->content; + $dropcap = ''; + } + $content .= '

' . $item->content . '

'; } } }