cebe / markdown

A super fast, highly extensible markdown parser for PHP

Home Page:http://markdown.cebe.cc/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception thrown on lines with spaces after list

czim opened this issue · comments

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.

isn't this fixed by 7e6fce6 ?

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

made it more robust with 4225204, thanks for reporting!