From b36e69d87e825a186d84e55e39b9a4c9c3f294cb Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 8 Apr 2016 09:50:13 +0100 Subject: [PATCH] Add extra debug variable to display requested page name. --- Changelog.md | 1 + build/index.php | 5 ++++- module_index.json | 4 ++-- modules/parser-parsedown.php | 5 ++++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Changelog.md b/Changelog.md index 17019a0..944bca7 100644 --- a/Changelog.md +++ b/Changelog.md @@ -10,6 +10,7 @@ - Uploads show with an arrow next to them along with the size of the uploaded file - Added mathematical expression parsing between dollar signs. - Generated previews now have etags. This should speed up load times of subsequent requests significantly. + - Added an extra debug variable that displays the top level page name (i.e. the page that has been requested). It can be used like this: `{{{~}}}` # Changed - Enhanced the dev help page some more diff --git a/build/index.php b/build/index.php index 1d6d64a..3dc875b 100644 --- a/build/index.php +++ b/build/index.php @@ -4122,7 +4122,7 @@ register_module([ register_module([ "name" => "Parsedown", - "version" => "0.6", + "version" => "0.6.1", "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", @@ -4243,6 +4243,9 @@ class PeppermintParsedown extends ParsedownExtra } $variableValue .= "\n"; break; + case "~": + if(!empty($this->paramStack)) + $variableValue = $this->escapeText($env->page); // TODO: Add a option that displays a list of subpages here } if(isset($params[$variableKey])) diff --git a/module_index.json b/module_index.json index adea918..6154f19 100644 --- a/module_index.json +++ b/module_index.json @@ -190,11 +190,11 @@ }, { "name": "Parsedown", - "version": "0.6", + "version": "0.6.1", "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": 1460104210, + "lastupdate": 1460105270, "optional": false } ] \ No newline at end of file diff --git a/modules/parser-parsedown.php b/modules/parser-parsedown.php index 33b5307..009e6bb 100644 --- a/modules/parser-parsedown.php +++ b/modules/parser-parsedown.php @@ -1,7 +1,7 @@ "Parsedown", - "version" => "0.6", + "version" => "0.6.1", "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", @@ -122,6 +122,9 @@ class PeppermintParsedown extends ParsedownExtra } $variableValue .= "\n"; break; + case "~": + if(!empty($this->paramStack)) + $variableValue = $this->escapeText($env->page); // TODO: Add a option that displays a list of subpages here } if(isset($params[$variableKey]))