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