diff --git a/Parsedown.php b/Parsedown.php index 15c5c9c..fb6aa3a 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -1312,6 +1312,11 @@ class Parsedown $Span = $this->identifyLink($Excerpt); + if ($Span === null) + { + return; + } + $Span['extent'] ++; $Span['element'] = array( diff --git a/test/data/image_reference.html b/test/data/image_reference.html index 6e45cba..67fbd2c 100644 --- a/test/data/image_reference.html +++ b/test/data/image_reference.html @@ -1 +1,2 @@ -

Markdown Logo

\ No newline at end of file +

Markdown Logo

+

![missing reference]

\ No newline at end of file diff --git a/test/data/image_reference.md b/test/data/image_reference.md index dcb1414..1e11d94 100644 --- a/test/data/image_reference.md +++ b/test/data/image_reference.md @@ -1,3 +1,5 @@ ![Markdown Logo][image] [image]: /md.png + +![missing reference] \ No newline at end of file