diff --git a/build/index.php b/build/index.php index e1d8661..c7c3d58 100644 --- a/build/index.php +++ b/build/index.php @@ -3318,6 +3318,8 @@ register_module([ // Read in the new page content $pagedata = $_POST["content"]; + /*** Note needed anymore as Parsedown has an option that does *** + *** this for us, and is _way_ more intelligent about it. *** // Santise it if necessary if($settings->clean_raw_html) { @@ -3327,6 +3329,7 @@ register_module([ // the less than sign ('<') that is used to open HTML tags. $pagedata = str_replace(">", ">", $pagedata); } + ***/ // Read in the new page tags, so long as there are actually some tags to read in $page_tags = []; @@ -4155,6 +4158,11 @@ register_module([ $parser = new PeppermintParsedown(); $parser->setInternalLinkBase("?page=%s"); add_parser("parsedown", function($source) use ($parser) { + global $settings; + if($settings->clean_raw_html) + $parser->setMarkupEscaped(true); + else + $parser->setMarkupEscaped(false); $result = $parser->text($source); return $result; diff --git a/module_index.json b/module_index.json index fe913f9..414b7db 100644 --- a/module_index.json +++ b/module_index.json @@ -104,7 +104,7 @@ "author": "Starbeamrainbowlabs", "description": "Allows you to edit pages by adding the edit and save actions. You should probably include this one.", "id": "page-edit", - "lastupdate": 1460142693, + "lastupdate": 1460145881, "optional": false }, { @@ -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": 1460137501, + "lastupdate": 1460145045, "optional": false } ] \ No newline at end of file diff --git a/modules/page-edit.php b/modules/page-edit.php index ae374bd..f23a975 100644 --- a/modules/page-edit.php +++ b/modules/page-edit.php @@ -123,6 +123,8 @@ register_module([ // Read in the new page content $pagedata = $_POST["content"]; + /*** Note needed anymore as Parsedown has an option that does *** + *** this for us, and is _way_ more intelligent about it. *** // Santise it if necessary if($settings->clean_raw_html) { @@ -132,6 +134,7 @@ register_module([ // the less than sign ('<') that is used to open HTML tags. $pagedata = str_replace(">", ">", $pagedata); } + ***/ // Read in the new page tags, so long as there are actually some tags to read in $page_tags = []; diff --git a/modules/parser-parsedown.php b/modules/parser-parsedown.php index 009e6bb..d09118b 100644 --- a/modules/parser-parsedown.php +++ b/modules/parser-parsedown.php @@ -11,6 +11,11 @@ register_module([ $parser = new PeppermintParsedown(); $parser->setInternalLinkBase("?page=%s"); add_parser("parsedown", function($source) use ($parser) { + global $settings; + if($settings->clean_raw_html) + $parser->setMarkupEscaped(true); + else + $parser->setMarkupEscaped(false); $result = $parser->text($source); return $result;