mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-22 16:33:00 +00:00
Start writing backend ext_renderer, but it's not finished yet.
This commit is contained in:
parent
fd5dd9a7c2
commit
9d2be94f64
2 changed files with 26 additions and 1 deletions
|
@ -337,7 +337,7 @@
|
|||
"version": "0.10",
|
||||
"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 some weight to your installation.",
|
||||
"lastupdate": 1571603632,
|
||||
"lastupdate": 1571604819,
|
||||
"optional": false,
|
||||
"extra_data": {
|
||||
"Parsedown.php": "https:\/\/raw.githubusercontent.com\/erusev\/parsedown\/fe7a50eceb4a3c867cc9fa9c0aa906b1067d1955\/Parsedown.php",
|
||||
|
|
|
@ -59,7 +59,32 @@ register_module([
|
|||
http_response_code(400);
|
||||
header("content-type: image/png");
|
||||
imagepng(errorimage("Error: No source text \nspecified."));
|
||||
exit();
|
||||
}
|
||||
|
||||
if(!isset($_GET["language"])) {
|
||||
http_response_code(400);
|
||||
header("content-type: image/png");
|
||||
imagepng(errorimage("Error: No external renderer \nlanguage specified."));
|
||||
exit();
|
||||
}
|
||||
|
||||
$source = $_GET["source"];
|
||||
$language = $_GET["language"];
|
||||
|
||||
if(!isset($settings->parser_ext_renderers->$language)) {
|
||||
$message = "Error: Unknown language {$_GET["language"]}.\nSupported languages:\n";
|
||||
foreach($settings->parser_ext_renderers as $language => $spec)
|
||||
$message .= "$spec->name ($language)\n";
|
||||
|
||||
http_response_code(400);
|
||||
header("content-type: image/png");
|
||||
imagepng(errorimage(trim($message)));
|
||||
exit();
|
||||
}
|
||||
|
||||
header("content-type: image/png");
|
||||
imagepng(errorimage("Not implemented yet.\nComing soon :-)"));
|
||||
});
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue