politis: tranform zoom divs into aside tags
This commit is contained in:
parent
f5fd44291e
commit
e0d841c594
12
epub.php
12
epub.php
|
@ -470,6 +470,18 @@
|
|||
$date = $finder->query('//span[@class="date"]')->item(0)->textContent;
|
||||
$summary = $finder->query('//div[@class="extrait"]')->item(0)->textContent;
|
||||
|
||||
// tranform "zoom" divs into aside tags
|
||||
$zooms = $finder->query('//div[contains(@class,"gt_zoom")]');
|
||||
foreach ($zooms as $zoom)
|
||||
{
|
||||
$aside = $doc->createElement('aside');
|
||||
while ($zoom->childNodes->length > 0)
|
||||
{
|
||||
$aside->appendChild($zoom->childNodes->item(0));
|
||||
}
|
||||
$zoom->parentNode->replaceChild($aside, $zoom);
|
||||
}
|
||||
|
||||
$result = '<h1>' . $title . '</h1>';
|
||||
$result .= '<p>' . $author . '</p>';
|
||||
$result .= '<p>' . $date . '</p>';
|
||||
|
|
Loading…
Reference in New Issue