Currently I use CodeIgniter 3.1.3 and Parsedown / Markdown Guide
With parse down I would like to be able to set the width and height of the image
![enter image description][1]
[1]: http://www.example.com/image.png '100x200' <-- widthxheight
I try the the way above but sets image title instead.
Output would be
<img src="http://www.example.com/image.png" width="100" height="200" alt="enter image description">
Question in parsedown library is there any way to modify it so can get and set the width and height of image?
protected function inlineImage($Excerpt)
{
if ( ! isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '[')
{
return;
}
$Excerpt['text']= substr($Excerpt['text'], 1);
$Link = $this->inlineLink($Excerpt);
if ($Link === null)
{
return;
}
$Inline = array(
'extent' => $Link['extent'] + 1,
'element' => array(
'name' => 'img',
'attributes' => array(
'src' => $Link['element']['attributes']['href'],
'alt' => $Link['element']['text'],
'width' => '',
'height' => ''
),
),
);
$Inline['element']['attributes'] += $Link['element']['attributes'];
unset($Inline['element']['attributes']['href']);
return $Inline;
}