1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-26 05:32:59 +00:00

Bugfix: Nest external rendered images inside a <p> to make them block-level

This commit is contained in:
Starbeamrainbowlabs 2019-10-25 00:16:08 +01:00
parent bba614df2f
commit 657213c11c
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
2 changed files with 8 additions and 5 deletions

View file

@ -337,7 +337,7 @@
"version": "0.10", "version": "0.10",
"author": "Emanuil Rusev & Starbeamrainbowlabs", "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.", "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": 1571947549, "lastupdate": 1571958901,
"optional": false, "optional": false,
"extra_data": { "extra_data": {
"Parsedown.php": "https:\/\/raw.githubusercontent.com\/erusev\/parsedown\/fe7a50eceb4a3c867cc9fa9c0aa906b1067d1955\/Parsedown.php", "Parsedown.php": "https:\/\/raw.githubusercontent.com\/erusev\/parsedown\/fe7a50eceb4a3c867cc9fa9c0aa906b1067d1955\/Parsedown.php",

View file

@ -1007,11 +1007,14 @@ class PeppermintParsedown extends ParsedownExtreme
$renderer = $settings->parser_ext_renderers->$language; $renderer = $settings->parser_ext_renderers->$language;
$result["element"] = [ $result["element"] = [
"name" => "p",
"element" => [
"name" => "img", "name" => "img",
"attributes" => [ "attributes" => [
"alt" => "Diagram rendered by {$renderer->name}", "alt" => "Diagram rendered by {$renderer->name}",
"src" => "?action=parsedown-render-ext&language=$language&immutable_key=".hash("crc32b", json_encode($renderer))."&source=".rawurlencode($text) "src" => "?action=parsedown-render-ext&language=$language&immutable_key=".hash("crc32b", json_encode($renderer))."&source=".rawurlencode($text)
] ]
]
]; ];
return $result; return $result;