Merge branch 'feature/process_ordering' into develop

This commit is contained in:
Andy Miller
2015-01-20 18:08:41 -07:00

View File

@@ -348,8 +348,7 @@ class Page
$update_cache = false;
if ($this->content === false) {
// Process Markdown
$this->content = $this->processMarkdown();
$this->content = $this->shouldProcess('markdown') ? $this->parseMarkdownContent($this->raw_content) : $this->raw_content;
$update_cache = true;
}
@@ -361,6 +360,7 @@ class Page
// Do we want to cache markdown, but process twig in each page?
if ($update_cache && $process_twig) {
self::$grav->fireEvent('onPageContentProcessed', new Event(['page' => $this]));
$cache->save($cache_id, $this->content);
$update_cache = false;
}
@@ -1592,32 +1592,6 @@ class Page
return $file && $file->exists();
}
/**
* Process the Markdown if processing is enabled for it. If not, process as 'raw' which simply strips the
* header YAML from the raw, and sends back the content portion. i.e. the bit below the header.
*
* @return string the content for the page
*/
protected function processMarkdown()
{
// Process Markdown if required
$process_method = $this->shouldProcess('markdown') ? 'parseMarkdownContent' : 'rawContent';
$content = $this->$process_method($this->raw_content);
return $content;
}
/**
* Process the raw content. Basically just strips the headers out and returns the rest.
*
* @param string $content Input raw content
* @return string Output content after headers have been stripped
*/
protected function rawContent($content)
{
return $content;
}
/**
* Process the Markdown content. This strips the headers, the process the resulting content as Markdown.
*