diff --git a/modules/page-edit.php b/modules/page-edit.php index 0005f63..e479456 100644 --- a/modules/page-edit.php +++ b/modules/page-edit.php @@ -111,12 +111,6 @@ register_module([ $pagedata = htmlentities($_POST["content"], ENT_QUOTES); - // Execute all the preprocessors - foreach($save_preprocessors as $func) - { - $func($pagedata); - } - if(file_put_contents("$env->page.md", $pagedata) !== false) { $page = $env->page; @@ -136,6 +130,14 @@ register_module([ else $pageindex->$page->lasteditor = utf8_encode("anonymous"); + + // Execute all the preprocessors + foreach($save_preprocessors as $func) + { + $func($pageindex->$page, $pagedata); + } + + file_put_contents("./pageindex.json", json_encode($pageindex, JSON_PRETTY_PRINT)); if(isset($_GET["newpage"]))