mirror of
https://github.com/getgrav/grav.git
synced 2026-05-07 14:35:30 +02:00
Merge pull request #150 from Sommerregen/bugfix/parsedown-handle-empty-html-anchors
Changed Twig Link Regex which fixes #149 [Markdown Doesn't Handle [words](#)
This commit is contained in:
@@ -19,7 +19,7 @@ trait ParsedownGravTrait
|
||||
protected $pages_dir;
|
||||
protected $special_chars;
|
||||
|
||||
protected $twig_link_regex = '/\!*\[(?:.*)\]\(([{{|{%|{#].*[#}|%}|}}])\)/';
|
||||
protected $twig_link_regex = '/\!*\[(?:.*)\]\((\{([\{%#])\s*(.*?)\s*(?:\2|\})\})\)/';
|
||||
|
||||
/**
|
||||
* Initialiazation function to setup key variables needed by the MarkdownGravLinkTrait
|
||||
@@ -227,7 +227,7 @@ trait ParsedownGravTrait
|
||||
$url = parse_url(htmlspecialchars_decode($excerpt['element']['attributes']['href']));
|
||||
|
||||
// if there is no scheme, the file is local
|
||||
if (!isset($url['scheme'])) {
|
||||
if (!isset($url['scheme']) and (count($url) > 0)) {
|
||||
// convert the URl is required
|
||||
$excerpt['element']['attributes']['href'] = $this->convertUrl(Uri::buildUrl($url));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user