maj grav
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Grav.Common.Markdown
|
||||
* @package Grav\Common\Markdown
|
||||
*
|
||||
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
|
||||
* @copyright Copyright (C) 2015 - 2019 Trilby Media, LLC. All rights reserved.
|
||||
* @license MIT License; see LICENSE file for details.
|
||||
*/
|
||||
|
||||
namespace Grav\Common\Markdown;
|
||||
|
||||
use Grav\Common\Page\Interfaces\PageInterface;
|
||||
use Grav\Common\Page\Markdown\Excerpts;
|
||||
|
||||
class Parsedown extends \Parsedown
|
||||
{
|
||||
use ParsedownGravTrait;
|
||||
@@ -15,12 +19,21 @@ class Parsedown extends \Parsedown
|
||||
/**
|
||||
* Parsedown constructor.
|
||||
*
|
||||
* @param $page
|
||||
* @param $defaults
|
||||
* @param Excerpts|null $excerpts
|
||||
* @param array|null $defaults
|
||||
*/
|
||||
public function __construct($page, $defaults)
|
||||
public function __construct($excerpts = null, $defaults = null)
|
||||
{
|
||||
$this->init($page, $defaults);
|
||||
if (!$excerpts || $excerpts instanceof PageInterface || null !== $defaults) {
|
||||
// Deprecated in Grav 1.6.10
|
||||
if ($defaults) {
|
||||
$defaults = ['markdown' => $defaults];
|
||||
}
|
||||
$excerpts = new Excerpts($excerpts, $defaults);
|
||||
user_error(__CLASS__ . '::' . __FUNCTION__ . '($page, $defaults) is deprecated since Grav 1.6.10, use new ' . __CLASS__ . '(new ' . Excerpts::class . '($page, [\'markdown\' => $defaults])) instead.', E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$this->init($excerpts, $defaults);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user