evilstreak / markdown-js

A Markdown parser for javascript
7.7k stars 863 forks source link

Fixed error when link reference are inside blockquotes #78

Closed HersonHN closed 7 years ago

HersonHN commented 11 years ago

When I trying to parse this (malformed) piece of markdown, it throws an error

> Let's fork this repo!
>
> [markdown][]
>

> [markdown]: https://github.com/evilstreak/markdown-js

Error:

TypeError: Object #<Object> has no method 'replace'
evilstreak commented 11 years ago

I added a test and a fix for this in d5b45735169ec6b57c137d6466a2d33fb94ac89d, but then realised the output I was testing for was wrong.

I plan to match the behaviour of (most) other markdown parsers. That is to say, your example code should parse to three paragraphs of text inside a blockquote with no links.

On the bright side, it doesn't throw an error any more! I'll correct my mistake after I've had some sleep.