diff --git a/build/index.php b/build/index.php index 802293c..7d71abd 100644 --- a/build/index.php +++ b/build/index.php @@ -4645,6 +4645,7 @@ class PeppermintParsedown extends ParsedownExtra protected function inlineExtendedImage($fragment) { + global $pageindex; ///^!\[(.*)\]\(([^ |)]+)\s*(?:\|([^|)]*)(?:\|([^)]*))?)?\)/ if(preg_match('/^!\[(.*)\]\(([^ |)]+)\s*(?:\|([^|)]*))?(?:\|([^|)]*))?(?:\|([^)]*))?\)/', $fragment["text"], $matches)) { @@ -4701,6 +4702,12 @@ class PeppermintParsedown extends ParsedownExtra if($param3 !== false && strtolower(trim($param3)) == "caption") $imageCaption = true; + if(isset($pageindex->$imageUrl) and $pageindex->$imageUrl->uploadedfile) + { + // We have a short url! Expand it. + $imageUrl = "index.php?action=preview&size=" . max($imageSize["x"], $imageSize["y"]) ."&page=" . rawurlencode($imageUrl); + } + $style = ""; if($imageSize !== false) $style .= " max-width: " . $imageSize["x"] . "px; max-height: " . $imageSize["y"] . "px;"; @@ -4771,7 +4778,7 @@ class PeppermintParsedown extends ParsedownExtra $result["element"], [ "name" => "figcaption", - "text" => htmlentities($altText) + "text" => $altText ], ], "attributes" => [ diff --git a/module_index.json b/module_index.json index 2e7d34c..4a55edd 100644 --- a/module_index.json +++ b/module_index.json @@ -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 some weight to your installation, and also *requires* write access to the disk on first load.", "id": "parser-parsedown", - "lastupdate": 1464550150, + "lastupdate": 1464601879, "optional": false } ] \ No newline at end of file diff --git a/modules/parser-parsedown.php b/modules/parser-parsedown.php index 43f6268..ca7cedf 100644 --- a/modules/parser-parsedown.php +++ b/modules/parser-parsedown.php @@ -331,6 +331,7 @@ class PeppermintParsedown extends ParsedownExtra protected function inlineExtendedImage($fragment) { + global $pageindex; ///^!\[(.*)\]\(([^ |)]+)\s*(?:\|([^|)]*)(?:\|([^)]*))?)?\)/ if(preg_match('/^!\[(.*)\]\(([^ |)]+)\s*(?:\|([^|)]*))?(?:\|([^|)]*))?(?:\|([^)]*))?\)/', $fragment["text"], $matches)) { @@ -387,6 +388,12 @@ class PeppermintParsedown extends ParsedownExtra if($param3 !== false && strtolower(trim($param3)) == "caption") $imageCaption = true; + if(isset($pageindex->$imageUrl) and $pageindex->$imageUrl->uploadedfile) + { + // We have a short url! Expand it. + $imageUrl = "index.php?action=preview&size=" . max($imageSize["x"], $imageSize["y"]) ."&page=" . rawurlencode($imageUrl); + } + $style = ""; if($imageSize !== false) $style .= " max-width: " . $imageSize["x"] . "px; max-height: " . $imageSize["y"] . "px;"; @@ -457,7 +464,7 @@ class PeppermintParsedown extends ParsedownExtra $result["element"], [ "name" => "figcaption", - "text" => htmlentities($altText) + "text" => $altText ], ], "attributes" => [