mirror of
https://github.com/erusev/parsedown.git
synced 2024-09-20 03:51:29 +02:00
Make it possible to disable images
This commit is contained in:
parent
468d1e3da8
commit
d264130ab9
@ -75,6 +75,16 @@ class Parsedown
|
||||
|
||||
protected $urlsLinked = true;
|
||||
|
||||
function setImagesEnabled($imagesEnabled)
|
||||
# Note: You should also set markupEscaped to disable images, otherwise people can still use <img> tags.
|
||||
{
|
||||
$this->imagesEnabled = $imagesEnabled;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected $imagesEnabled = true;
|
||||
|
||||
#
|
||||
# Lines
|
||||
#
|
||||
@ -1136,7 +1146,7 @@ class Parsedown
|
||||
|
||||
protected function inlineImage($Excerpt)
|
||||
{
|
||||
if ( ! isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '[')
|
||||
if ( ! isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '[' or ! $this->imagesEnabled )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user