fix for summary miscalculation - take 2

This commit is contained in:
Andy Miller
2014-11-25 17:54:57 -07:00
parent dd6986e5ff
commit 1a5102e47b

View File

@@ -260,13 +260,6 @@ class Page
{
$content = $this->content();
// Handle summary divider
$divider_pos = strpos($content, '<p>'.SUMMARY_DELIMITER.'</p>');
if ($divider_pos !== false) {
$this->summary_size = $divider_pos;
$content = str_replace('<p>'.SUMMARY_DELIMITER.'</p>', '', $content);
}
// Return calculated summary based on summary divider's position
if (!$size && isset($this->summary_size)) {
return substr($content, 0, $this->summary_size);
@@ -350,13 +343,20 @@ class Page
}
}
// Process any post-processing but pre-caching functionality
self::$grav->fireEvent('onPageContentProcessed', new Event(['page' => $this]));
// Cache the whole page, including processed content
if ($update_cache) {
$cache->save($cache_id, $this->content);
}
// Process any post-processing but pre-caching functionality
self::$grav->fireEvent('onPageContentProcessed', new Event(['page' => $this]));
// Handle summary divider
$divider_pos = strpos($this->content, '<p>'.SUMMARY_DELIMITER.'</p>');
if ($divider_pos !== false) {
$this->summary_size = $divider_pos;
$this->content = str_replace('<p>'.SUMMARY_DELIMITER.'</p>', '', $this->content);
}
}