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 . '

'; } } }