Languages fixed again, was issue with type

This commit is contained in:
Andy Miller
2016-10-06 18:30:03 -06:00
parent 9a21792b27
commit ce2b7d7175
2 changed files with 8 additions and 11 deletions

View File

@@ -86,7 +86,7 @@ class Excerpts
return $html;
}
public static function processLinkExcerpt($excerpt, $page)
public static function processLinkExcerpt($excerpt, $page, $type = 'link')
{
$url = $excerpt['element']['attributes']['href'];
@@ -142,13 +142,6 @@ class Excerpts
return $excerpt;
}
// Get Type
if (isset($excerpt['type'])) {
$type = $excerpt['type'];
} else {
$type = 'link';
}
// handle paths and such
$url_parts = Uri::convertUrl($page, $url_parts, $type);

View File

@@ -10,8 +10,6 @@ namespace Grav\Common\Markdown;
use Grav\Common\Grav;
use Grav\Common\Helpers\Excerpts;
use Grav\Common\Uri;
use Grav\Common\Utils;
use RocketTheme\Toolbox\Event\Event;
trait ParsedownGravTrait
@@ -204,6 +202,12 @@ trait ParsedownGravTrait
protected function inlineLink($excerpt)
{
if (isset($excerpt['type'])) {
$type = $excerpt['type'];
} else {
$type = 'link';
}
// do some trickery to get around Parsedown requirement for valid URL if its Twig in there
if (preg_match($this->twig_link_regex, $excerpt['text'], $matches)) {
$excerpt['text'] = str_replace($matches[1], '/', $excerpt['text']);
@@ -218,7 +222,7 @@ trait ParsedownGravTrait
// if this is a link
if (isset($excerpt['element']['attributes']['href'])) {
$excerpt = Excerpts::processLinkExcerpt($excerpt, $this->page);
$excerpt = Excerpts::processLinkExcerpt($excerpt, $this->page, $type);
}
return $excerpt;