Part 2 of greedy fix

This commit is contained in:
Andy Miller
2015-01-23 16:37:20 -07:00
parent 05bd5cb964
commit 8b251ca350

View File

@@ -220,7 +220,7 @@ trait ParsedownGravTrait
// If this is a 'real' filepath clean it up
if (file_exists($this->page->path() . '/' . parse_url($markdown_url, PHP_URL_PATH))) {
$relative_path = $this->base_url . preg_replace('/\/([\d]+\.)/', '/', str_replace($this->pages_dir, '', $this->page->path()));
$markdown_url = preg_replace('/^([\d]+.)/', '', preg_replace('/\/([\d]+.)/', '/', trim(preg_replace('/[^\/]+(\.md$)/', '', $markdown_url), '/')));
$markdown_url = preg_replace('/^([\d]+\.)/', '', preg_replace('/\/([\d]+\.)/', '/', trim(preg_replace('/[^\/]+(\.md$)/', '', $markdown_url), '/')));
}
// else its a relative path already