diff --git a/system/src/Grav/Common/Page/Medium/Medium.php b/system/src/Grav/Common/Page/Medium/Medium.php index 342efb3ae..3eea145e4 100644 --- a/system/src/Grav/Common/Page/Medium/Medium.php +++ b/system/src/Grav/Common/Page/Medium/Medium.php @@ -229,7 +229,7 @@ class Medium extends Data implements RenderableInterface } if (empty($attributes['alt'])) { - if (!empty($alt)) { + if (!empty($alt) || $alt === '') { $attributes['alt'] = $alt; } elseif (!empty($this->items['alt'])) { $attributes['alt'] = $this->items['alt']; diff --git a/tests/unit/Grav/Common/Markdown/ParsedownTest.php b/tests/unit/Grav/Common/Markdown/ParsedownTest.php index c3a2c2634..bbd1cad3a 100644 --- a/tests/unit/Grav/Common/Markdown/ParsedownTest.php +++ b/tests/unit/Grav/Common/Markdown/ParsedownTest.php @@ -78,18 +78,18 @@ class ParsedownTest extends \Codeception\TestCase\Test $this->grav['language'] = new Language($this->grav); $this->uri->initializeWithURL('http://testing.dev/fr/item2/item2-2')->init(); - $this->assertSame('


<\/p>|',
+ $this->assertRegexp('|
<\/p>|',
$this->parsedown->text(''));
$this->uri->initializeWithURL('http://testing.dev/item2/item2-2')->init();
- $this->assertSame('


<\/p>|',
+ $this->assertRegexp('|
<\/p>|',
$this->parsedown->text(''));
- $this->assertRegexp('|
<\/p>|',
+ $this->assertRegexp('|
<\/p>|',
$this->parsedown->text(''));
$this->assertSame('

<\/p>|',
+ $this->assertRegexp('|
<\/p>|',
$this->parsedown->text(''));
- $this->assertSame('


<\/p>|',
+ $this->assertRegexp('|
<\/p>|',
$this->parsedown->text(''));
$this->assertSame('



<\/p>|',
+ $this->assertRegexp('|
<\/p>|',
$this->parsedown->text(''));
- $this->assertRegexp('|
<\/p>|',
+ $this->assertRegexp('|
<\/p>|',
$this->parsedown->text(''));
$this->assertSame('



<\/p>|',
+ $this->assertRegexp('|
<\/p>|',
$this->parsedown->text(''));
- $this->assertRegexp('|
<\/p>|',
+ $this->assertRegexp('|
<\/p>|',
$this->parsedown->text(''));
$this->assertSame('












<\/p>|',
+ $this->assertRegexp('|
<\/p>|',
$this->parsedown->text(''));
- $this->assertRegexp('|
<\/p>|',
+ $this->assertRegexp('|
<\/p>|',
$this->parsedown->text(''));
$this->assertSame('





<\/p>|',
+ $this->assertRegexp('|
<\/p>|',
$this->parsedown->text(''));
- $this->assertRegexp('|
<\/p>|',
+ $this->assertRegexp('|
<\/p>|',
$this->parsedown->text(''));
$this->assertSame('
