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

Tentative fix for style warnings when rendering image captions

This commit is contained in:
Starbeamrainbowlabs 2018-02-04 13:26:05 +00:00
parent 160800def9
commit 0dde3c824b
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
4 changed files with 5 additions and 3 deletions

View file

@ -7,6 +7,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
- Properly escaped content of short code box on file pages
- Display a more meaningful message to a logged in user if editing is disabled
- Fixed fetching the size of SVGs in some cases
- Fixed image captions in some cases (let me know if you still get warnings)
### Changed
- Disallow uploads if editing is disabled. Previously files could still be uploaded even if editing was disabled - unless `upload_enabled` was set to `false`.

View file

@ -8368,7 +8368,7 @@ class PeppermintParsedown extends ParsedownExtra
if($imageCaption)
{
$rawStyle = $result["element"]["attributes"]["style"];
$rawStyle = $result["element"]["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": 1510610037,
"lastupdate": 1517750247,
"optional": false
}
]

View file

@ -1,7 +1,7 @@
<?php
register_module([
"name" => "Parsedown",
"version" => "0.9.9",
"version" => "0.9.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, and also *requires* write access to the disk on first load.",
"id" => "parser-parsedown",
@ -598,6 +598,7 @@ class PeppermintParsedown extends ParsedownExtra
if($imageCaption)
{
//$rawStyle = $result["element"]["attributes"]["style"] ?? "";
$rawStyle = $result["element"]["attributes"]["style"];
$containerStyle = preg_replace('/^.*float/', "float", $rawStyle);
$mediaStyle = preg_replace('/\s*float.*;/', "", $rawStyle);