Reputation: 820
I need to write in my gitlab project wiki page a code block that contains square brackets. Unfortunately the square brackets are turn into a link. I assume gitlab is using markdown language or the gfm flavor.
This is my code:
```javascript
"{bla, """", [[foo],[]]}"
```
The foo],[
part is turn into a link. So basicaly I need a way to write a square brackets tah are not treated as a link. Surprisingly google doesn't provide any answer for such a trivial issue.
Upvotes: 1
Views: 6516
Reputation: 6363
The current answer is that you can't do this. It is a know bug in GitLab, specifically in Wiki pages. GitLab markdown correctly handles square brackets in comments, and code blocks entered in issues, but NOT in wiki pages.
Please add your vote (thumbs up) on the issue to try and get it resolved:
https://gitlab.com/gitlab-org/gitlab-ce/issues/18725
Your (not very appealing) options boil down to these:
`"{bla, """", [[foo],[]]}"`
{{
), and include a note outside the code block saying to replace {{
with [[
, etc - Note that you can use double brackets inside single quote blocks in GitLab Markdown.None of these are very nice solutions, but all you have at the moment.
Upvotes: 3