From e599e1bc18ebdb7fb0e52d3b1729b2eac1100a6f Mon Sep 17 00:00:00 2001 From: Hassan Khan Date: Thu, 23 Jan 2014 16:19:06 +0000 Subject: [PATCH] Updated ``Zepto\FileLoader\MarkdownLoader`` to use ``michelf/php-markdown`` --- library/Zepto/FileLoader/MarkdownLoader.php | 4 ++-- tests/Zepto/FileLoader/MarkdownLoaderTest.php | 24 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/library/Zepto/FileLoader/MarkdownLoader.php b/library/Zepto/FileLoader/MarkdownLoader.php index 3384eb2..f086d9b 100644 --- a/library/Zepto/FileLoader/MarkdownLoader.php +++ b/library/Zepto/FileLoader/MarkdownLoader.php @@ -11,7 +11,7 @@ namespace Zepto\FileLoader; -use Parsedown; +use \Michelf\MarkdownExtra; class MarkdownLoader extends \Zepto\FileLoader { @@ -85,7 +85,7 @@ private function parse_meta($file) private function parse_content($file) { $content = preg_replace('#/\*.+?\*/#s', '', $file); - return Parsedown::instance()->parse($content); + return MarkdownExtra::defaultTransform($content); } } diff --git a/tests/Zepto/FileLoader/MarkdownLoaderTest.php b/tests/Zepto/FileLoader/MarkdownLoaderTest.php index 052f93a..26d0047 100644 --- a/tests/Zepto/FileLoader/MarkdownLoaderTest.php +++ b/tests/Zepto/FileLoader/MarkdownLoaderTest.php @@ -49,8 +49,8 @@ public function testLoadSingleFile() 'title' => 'Error 404', 'robots' => 'noindex,nofollow' ), - 'content' => '

Error 404

' . PHP_EOL - . '

Woops. Looks like this page doesn\'t exist.

' + 'content' => '

Error 404

' . PHP_EOL. PHP_EOL + . '

Woops. Looks like this page doesn\'t exist.

'. PHP_EOL ); $result = $this->object->load(ROOT_DIR . 'content/404.md', array('md')); @@ -66,22 +66,22 @@ public function testLoadMultipleFiles() 'meta' => array( 'title' => 'Sub Page Index' ), - 'content' => '

This is a Sub Page Index

' . PHP_EOL - . '

This is index.md in the "sub" folder.

' . PHP_EOL - . '

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

' . PHP_EOL - . '

Donec ultricies tristique nulla et mattis.

' . PHP_EOL - . '

Phasellus id massa eget nisl congue blandit sit amet id ligula.

' + 'content' => '

This is a Sub Page Index

' . PHP_EOL. PHP_EOL + . '

This is index.md in the "sub" folder.

' . PHP_EOL. PHP_EOL + . '

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

' . PHP_EOL. PHP_EOL + . '

Donec ultricies tristique nulla et mattis.

' . PHP_EOL. PHP_EOL + . '

Phasellus id massa eget nisl congue blandit sit amet id ligula.

'. PHP_EOL ); $files['sub/page.md'] = array( 'meta' => array( 'title' => 'Sub Page' ), - 'content' => '

This is a Sub Page

' . PHP_EOL - . '

This is page.md in the "sub" folder.

' . PHP_EOL - . '

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

' . PHP_EOL - . '

Donec ultricies tristique nulla et mattis.

' . PHP_EOL - . '

Phasellus id massa eget nisl congue blandit sit amet id ligula.

' + 'content' => '

This is a Sub Page

' . PHP_EOL. PHP_EOL + . '

This is page.md in the "sub" folder.

' . PHP_EOL. PHP_EOL + . '

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

' . PHP_EOL. PHP_EOL + . '

Donec ultricies tristique nulla et mattis.

' . PHP_EOL. PHP_EOL + . '

Phasellus id massa eget nisl congue blandit sit amet id ligula.

'. PHP_EOL ); $result = $this->object->load(ROOT_DIR . 'content/sub', array('md'));