1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

Update Parsedown.php

This commit is contained in:
SilverServersCopiliot 2023-08-04 12:04:17 -07:00 committed by GitHub
parent 67126e85ef
commit 31eb54b220
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1379,7 +1379,7 @@ class Parsedown
);
//get width and height from href attribute if exists (ex: "http://www.example.com/image.png#100x100")
if (preg_match('/^(.*)#(\d*)x(\d*)$/', $Link['element']['attributes']['href'], $matches)) {
if (!empty($Inline['element']['attributes']['src'])&&preg_match('/^(.*)#(\d*)x(\d*)$/', $Link['element']['attributes']['href'], $matches)) {
if(isset($matches[2])) $Inline['element']['attributes']['width'] = $matches[2];
if(isset($matches[3])) $Inline['element']['attributes']['height'] = $matches[3];
$Inline['element']['attributes']['src'] = $matches[1];