Markdown inline code highlighting is too greedy
Summary
When a single line of a markdown file contains multiple inline code snippets, everything from the first snippet's backtick to the last snippet's backtick are highlighted. Both single- and triple-backticks are similarly affected.
Steps to reproduce
Create any block of code formatted as markdown, like the below:
- this is `a snippet,` this is not a snippet but is highlighted as one, `and here's another snippet`
- this line uses ```triple backticks``` and is similarly ```affected```
Alternatively, commit a Markdown file with the content above and look at the commit diff.
Expected behavior
Only the actual inline snippets (i.e. the parts between pairs of backticks) should be highlighted. Please note that this issue is about the highlighting of markdown code itself, and not the final rendered result of Markdown.
Relevant logs and/or screenshots
This issue's description is self-demonstrating (see above).
Output of checks
N/A (issue exists in gitlab.com, at least as at 8.9.1-ee 123941b
Possible fixes
My guess is that the markdown source highlighting uses a greedy quantifier, like `.+`
, whereas a lazy one like `.+?`
may be better. I have not looked at the source to confirm (and am not sure if this highlighting is done by a third-party lib; if so, I'll open an issue in that library's repo).