mirror of
https://github.com/getgrav/grav.git
synced 2026-03-05 12:01:37 +01:00
Merge remote-tracking branch 'origin/feature/objects' into feature/objects
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user