Merge remote-tracking branch 'origin/feature/objects' into feature/objects

This commit is contained in:
Matias Griese
2017-03-06 18:59:04 +02:00
2 changed files with 9 additions and 2 deletions

View File

@@ -4,6 +4,7 @@
1. [](#new)
* Added default setting to only allow `direct-installs` from official GPM. Can be configured in `system.yaml`
* Added a new `Utils::isValidUrl()` method
* Added optional parameter to `|markdown(false)` filter to toggle block/line processing (default|true = `block`)
1. [](#improved)
* Genericized `direct-install` so it can be called via Admin plugin
1. [](#bugfix)

View File

@@ -432,9 +432,10 @@ class TwigExtension extends \Twig_Extension
/**
* @param $string
*
* @param bool $block Block or Line processing
* @return mixed|string
*/
public function markdownFilter($string)
public function markdownFilter($string, $block = true)
{
$page = $this->grav['page'];
$defaults = $this->config->get('system.pages.markdown');
@@ -446,7 +447,12 @@ class TwigExtension extends \Twig_Extension
$parsedown = new Parsedown($page, $defaults);
}
$string = $parsedown->text($string);
if ($block) {
$string = $parsedown->text($string);
} else {
$string = $parsedown->line($string);
}
return $string;
}