1
0
mirror of https://github.com/typemill/typemill.git synced 2025-07-14 11:06:20 +02:00

Version 1.5.3: Parsedown option to ignore attributes for images

This commit is contained in:
trendschau
2022-02-02 21:57:02 +01:00
parent 2159c775be
commit 7c6ac35dfe

View File

@ -104,6 +104,13 @@ class ParsedownExtension extends \ParsedownExtra
}
return $markup;
}
protected $imageAttributes = true;
public function withoutImageAttributes()
{
$this->imageAttributes = false;
}
# BlockImages with html5 figure and figcaption
# No, this is not the most elegant code on planet earth!!
@ -152,7 +159,7 @@ class ParsedownExtension extends \ParsedownExtra
$attributeString = trim(str_replace(' ', ' ', $attributeString));
$line['text'] = substr($line['text'], 0, $matches[0][1]);
if(str_replace(' ', '', $attributeString) != '')
if(str_replace(' ', '', $attributeString) != '' && $this->imageAttributes)
{
$line['text'] .= '{' . $attributeString . '}';
}