diff --git a/build/index.php b/build/index.php index 1fbbcd9..e72a88c 100644 --- a/build/index.php +++ b/build/index.php @@ -3807,11 +3807,16 @@ class PeppermintParsedown extends ParsedownExtra if(preg_match("/\{\{\{([^}]+)\}\}\}/", $fragment["text"], $matches)) { $variableKey = trim($matches[1]); + + $variableValue = false; if(isset(array_slice($this->paramStack, -1)[0][$variableKey])) + $variableValue = array_slice($this->paramStack, -1)[0][$variableKey]; + + if($variableValue) { return [ "extent" => strlen($matches[0]), - "markup" => array_slice($this->paramStack, -1)[0][$variableKey] + "markup" => $variableValue ]; } } diff --git a/module_index.json b/module_index.json index 5b21a81..177ab15 100644 --- a/module_index.json +++ b/module_index.json @@ -194,7 +194,7 @@ "author": "Emanuil Rusev & Starbeamrainbowlabs", "description": "An upgraded (now default!) parser based on Emanuil Rusev's Parsedown Extra PHP library (https:\/\/github.com\/erusev\/parsedown-extra), which is licensed MIT. Please be careful, as this module adds a some weight to your installation, and also *requires* write access to the disk on first load.", "id": "parser-parsedown", - "lastupdate": 1458490248, + "lastupdate": 1458491883, "optional": false } ] \ No newline at end of file diff --git a/modules/parser-parsedown.php b/modules/parser-parsedown.php index 4b29032..6d81493 100644 --- a/modules/parser-parsedown.php +++ b/modules/parser-parsedown.php @@ -85,11 +85,16 @@ class PeppermintParsedown extends ParsedownExtra if(preg_match("/\{\{\{([^}]+)\}\}\}/", $fragment["text"], $matches)) { $variableKey = trim($matches[1]); + + $variableValue = false; if(isset(array_slice($this->paramStack, -1)[0][$variableKey])) + $variableValue = array_slice($this->paramStack, -1)[0][$variableKey]; + + if($variableValue) { return [ "extent" => strlen($matches[0]), - "markup" => array_slice($this->paramStack, -1)[0][$variableKey] + "markup" => $variableValue ]; } }