cebe / markdown

A super fast, highly extensible markdown parser for PHP
http://markdown.cebe.cc/
MIT License
997 stars 141 forks source link

Exception thrown on lines with spaces after list #145

Closed czim closed 6 years ago

czim commented 7 years ago

Rendering markdown as HTML throws an ErrorException: Uninitialized string offset: 0 in LinkTrait identifyReference().

This happens with the following markdown:

- List Item

Line to make sure empty lines with spaces are kept

The white-space is imporant here, which is:

- List Item
<doesn't matter, empty line or some spaces>
<at least two spaces>
Line to make sure empty lines with spaces are kept

As soon as the above appears in a document, the error occurs.

cebe commented 7 years ago

isn't this fixed by https://github.com/cebe/markdown/commit/7e6fce6b656603c1289a45a41bca065ee8cf3058 ?

czim commented 7 years ago

It may be! But since empty(' ') is false, I'm not 100% on that and would have to check against my example markdown above.

cebe commented 6 years ago

made it more robust with 4225204, thanks for reporting!