mirror of
https://github.com/getgrav/grav.git
synced 2026-05-06 10:16:25 +02:00
requires changes in parsedown
This commit is contained in:
@@ -16,9 +16,11 @@ trait ParsedownGravTrait
|
||||
protected $base_url;
|
||||
protected $pages_dir;
|
||||
protected $special_chars;
|
||||
|
||||
protected $twig_link_regex = '/\!*\[(?:.*)\]\((\{([\{%#])\s*(.*?)\s*(?:\2|\})\})\)/';
|
||||
|
||||
public $completeable_blocks = [];
|
||||
public $continueable_blocks = [];
|
||||
|
||||
/**
|
||||
* Initialization function to setup key variables needed by the MarkdownGravLinkTrait
|
||||
*
|
||||
@@ -55,9 +57,17 @@ trait ParsedownGravTrait
|
||||
* @param $type
|
||||
* @param $tag
|
||||
*/
|
||||
public function addBlockType($type, $tag)
|
||||
public function addBlockType($type, $tag, $continueable = false, $completeable = false)
|
||||
{
|
||||
$this->BlockTypes[$type] []= $tag;
|
||||
|
||||
if ($continueable) {
|
||||
$this->continueable_blocks[] = $tag;
|
||||
}
|
||||
|
||||
if ($completeable) {
|
||||
$this->completeable_blocks[] = $tag;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,6 +82,18 @@ trait ParsedownGravTrait
|
||||
$this->inlineMarkerList .= $type;
|
||||
}
|
||||
|
||||
protected function isBlockContinueable($Type)
|
||||
{
|
||||
$continueable = in_array($Type, $this->continueable_blocks) || method_exists($this, 'block'.$Type.'Continue');
|
||||
return $continueable;
|
||||
}
|
||||
|
||||
protected function isBlockCompleteable($Type)
|
||||
{
|
||||
$completeable = in_array($Type, $this->completeable_blocks) || method_exists($this, 'block'.$Type.'Complete');
|
||||
return $completeable;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Make the element function publicly accessible, Medium uses this to render from Twig
|
||||
@@ -295,4 +317,6 @@ trait ParsedownGravTrait
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user