1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-22 04:23:01 +00:00

Bugfix: Images with captions didn't float correctly.

This commit is contained in:
Starbeamrainbowlabs 2018-04-05 09:47:29 +01:00
parent ef719c671e
commit 7a243215ec
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
4 changed files with 4 additions and 5 deletions

View file

@ -20,6 +20,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
- Normalise utf8 text to avoid duplicate ids and missing search results.
- Improved handling of mime types in some places in the API.
- Added `minified` option to `status` action to reduce data usage slightly
- Fixed floating images that have captions
- [Rest API] Fix `checklogin` action documentation
- Fix link on credits page

View file

@ -8433,8 +8433,7 @@ class PeppermintParsedown extends ParsedownExtra
if($imageCaption)
{
//$rawStyle = $result["element"]["attributes"]["style"] ?? "";
$rawStyle = $result["element"]["attributes"]["style"];
$rawStyle = $result["element"]["text"][0]["attributes"]["style"];
$containerStyle = preg_replace('/^.*float/', "float", $rawStyle);
$mediaStyle = preg_replace('/\s*float.*;/', "", $rawStyle);
$result["element"] = [

View file

@ -266,7 +266,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": 1517750660,
"lastupdate": 1522917987,
"optional": false
}
]

View file

@ -598,8 +598,7 @@ class PeppermintParsedown extends ParsedownExtra
if($imageCaption)
{
//$rawStyle = $result["element"]["attributes"]["style"] ?? "";
$rawStyle = $result["element"]["attributes"]["style"];
$rawStyle = $result["element"]["text"][0]["attributes"]["style"];
$containerStyle = preg_replace('/^.*float/', "float", $rawStyle);
$mediaStyle = preg_replace('/\s*float.*;/', "", $rawStyle);
$result["element"] = [