php-markdown
php-markdown copied to clipboard
add class to all image links?
Currently images are converted to :
<img alt="description" src="http://www.example.com/example.png">
Is there any way to add a class to all img tags so it would become :
<img class="img-responsive" alt="description" src="http://www.example.com/example.png">
I am modifying someone else's code, but all they are doing it using this line :
$result = MarkdownExtra::defaultTransform($original);
After the Markdown-to-HTML conversion, do this:
$result = str_replace('<img ', '<img class="img-responsive" ', $result);
So there is nothing built into markdown then... all I needed to know, thanks.