language-markdown icon indicating copy to clipboard operation
language-markdown copied to clipboard

Nested square brackets is not detected correctly

Open HyunSeob opened this issue 10 years ago • 2 comments

I just wanted to add a link with text includes square brackets as following:

[[ Original ]](https://github.com/burodepeper/language-markdown)

However, highlight didn't work correctly as following: 2016-04-10 10 19 14

I already saw #40, and I think my issue occured because of resolving #40.

HyunSeob avatar Apr 10 '16 13:04 HyunSeob

Hi @HyunSeob, thanks for reporting.

Yep, #40 "broke" this (kudos for looking through the closed issues btw!!). I intend to look into this eventually (I think nested whatevers are valid, but the regexes to parse them are a pain in the bum), but I'm afraid it's not high on my priority list at the moment.

If you are curious in trying to come up with a fix yourself: from what I can remember, the issue is not in allowing nested whatevers, but rather in a single unmatched bracket breaking everything that comes after it.

According to the specs:

Brackets are allowed in the link text only if (a) they are backslash-escaped or (b) they appear as a matched pair of brackets, with an open bracket [, a sequence of zero or more inlines, and a close bracket ].

I think the (a) part is do-able. I might have a jab at it if my schedule allows me next week. (b) proves more difficult, and creates issues/false positives when a matching bracket can't be found. Atom's grammar matching is a bit limited in that aspect. Also, I'm not (yet) a regex ninja ; )

burodepeper avatar Apr 10 '16 17:04 burodepeper

@burodepeper Thank you for reply! :D

This is not important issue to me too. I just wanted to report this. So, you think this is not high priority, you can resolve this later!

HyunSeob avatar Apr 11 '16 02:04 HyunSeob