mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Implement Reference
This commit is contained in:
@@ -288,31 +288,6 @@ class Parsedown
|
||||
return \method_exists($this, 'block' . $Type . 'Complete');
|
||||
}
|
||||
|
||||
#
|
||||
# Reference
|
||||
|
||||
protected function blockReference(Context $Context)
|
||||
{
|
||||
if (\strpos($Context->line()->text(), ']') !== false
|
||||
and \preg_match('/^\[(.+?)\]:[ ]*+<?(\S+?)>?(?:[ ]+["\'(](.+)["\')])?[ ]*+$/', $Context->line()->text(), $matches)
|
||||
) {
|
||||
$id = \strtolower($matches[1]);
|
||||
|
||||
$Data = [
|
||||
'url' => $matches[2],
|
||||
'title' => isset($matches[3]) ? $matches[3] : null,
|
||||
];
|
||||
|
||||
$this->DefinitionData['Reference'][$id] = $Data;
|
||||
|
||||
$Block = [
|
||||
'element' => [],
|
||||
];
|
||||
|
||||
return $Block;
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Table
|
||||
|
||||
|
||||
Reference in New Issue
Block a user