Does anyone else working with a syntax that makes Markdown links tappable have issues with more than one link in the same line?
Here’s the JSON I borrowed from the canonical Markdown+Links syntax:
"match": "(\\[)()(.*)(\\]\\()([^ ]*)(\\))",
"templates": {
"": "[[value_unencoded]]"
},
"enabled": true,
"captures": {
"value": "5",
"key": "2",
"prefix": "1",
"suffix": "6",
"link": "3"
},
"scopes": {
"value": "text.italic",
"key": "text.bold",
"prefix": "markup",
"suffix": "markup"
}
With two links in a line, the last url becomes the link and everything between becomes tappable.
Thought the fix might be as simple as tweaking the regex, but there’s something I’m missing between the regex and the key value assignments. So for example, this regex works to correctly parse multiple links in the same line:
"match": "(!?\\[)([^\\[]+)(\\])(\\()(\\S[^\\)]+)(\\))",
but I haven’t yet been able to make it tappable— I’d assume the “link” key should be assigned to match group 5, but no joy. I’m probably overlooking something obvious. Any pointers?
It’s not a big issue, and there are a few easy workarounds, but I’d love to understand where I’m going wrong…