Fixed a bug in matching link

These cases were parsed incorrectly:

```markdown
[this is a link](url

[this is [another] link](url)
```