Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

Commit

Permalink
Updated Zepto\FileLoader\MarkdownLoader to use ``michelf/php-mark…
Browse files Browse the repository at this point in the history
…down``
  • Loading branch information
hassankhan committed Jan 23, 2014
1 parent 2fd724c commit e599e1b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions library/Zepto/FileLoader/MarkdownLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Zepto\FileLoader;

use Parsedown;
use \Michelf\MarkdownExtra;

class MarkdownLoader extends \Zepto\FileLoader {

Expand Down Expand Up @@ -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);
}

}
24 changes: 12 additions & 12 deletions tests/Zepto/FileLoader/MarkdownLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public function testLoadSingleFile()
'title' => 'Error 404',
'robots' => 'noindex,nofollow'
),
'content' => '<h1>Error 404</h1>' . PHP_EOL
. '<p>Woops. Looks like this page doesn\'t exist.</p>'
'content' => '<h1>Error 404</h1>' . PHP_EOL. PHP_EOL
. '<p>Woops. Looks like this page doesn\'t exist.</p>'. PHP_EOL
);

$result = $this->object->load(ROOT_DIR . 'content/404.md', array('md'));
Expand All @@ -66,22 +66,22 @@ public function testLoadMultipleFiles()
'meta' => array(
'title' => 'Sub Page Index'
),
'content' => '<h2>This is a Sub Page Index</h2>' . PHP_EOL
. '<p>This is index.md in the "sub" folder.</p>' . PHP_EOL
. '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>' . PHP_EOL
. '<p>Donec ultricies tristique nulla et mattis.</p>' . PHP_EOL
. '<p>Phasellus id massa eget nisl congue blandit sit amet id ligula.</p>'
'content' => '<h2>This is a Sub Page Index</h2>' . PHP_EOL. PHP_EOL
. '<p>This is index.md in the "sub" folder.</p>' . PHP_EOL. PHP_EOL
. '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>' . PHP_EOL. PHP_EOL
. '<p>Donec ultricies tristique nulla et mattis.</p>' . PHP_EOL. PHP_EOL
. '<p>Phasellus id massa eget nisl congue blandit sit amet id ligula.</p>'. PHP_EOL
);

$files['sub/page.md'] = array(
'meta' => array(
'title' => 'Sub Page'
),
'content' => '<h2>This is a Sub Page</h2>' . PHP_EOL
. '<p>This is page.md in the "sub" folder.</p>' . PHP_EOL
. '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>' . PHP_EOL
. '<p>Donec ultricies tristique nulla et mattis.</p>' . PHP_EOL
. '<p>Phasellus id massa eget nisl congue blandit sit amet id ligula.</p>'
'content' => '<h2>This is a Sub Page</h2>' . PHP_EOL. PHP_EOL
. '<p>This is page.md in the "sub" folder.</p>' . PHP_EOL. PHP_EOL
. '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>' . PHP_EOL. PHP_EOL
. '<p>Donec ultricies tristique nulla et mattis.</p>' . PHP_EOL. PHP_EOL
. '<p>Phasellus id massa eget nisl congue blandit sit amet id ligula.</p>'. PHP_EOL
);

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

0 comments on commit e599e1b

Please sign in to comment.