When writing or commenting on a ticket or documentation in either JIRA or Confluence, I often highlight variable names or values with the inline-code markers (which is two open curly-braces, text, two closed curly-braces).
{{$foo}}
Now something that comes up regularly is the construct {}, which I just had to make italic instead of inline-code, because I don't understand how to escape it properly to make it show up.
I have tried a variety of things, including backslashes and spaces at various places. In the following I'll use a markdown-like syntax to show which part is highlighted. Things in backticks `$foo`
are turning up inside the highlighted area in the rendered JIRA output.
{{{}}} # {`}` {{ {} }} # {{ {} }} {{\{\}}} # {`}` {{\{}}} # {`}` {{{\}}} # {{ (that one is my favourite) # {\}} # } {{{{}}}} # {`}` {{{}}{{}}} # `}{`
This is highly weird. And very frustrating. This thing is relevant to JavaScript, JSON data and various other programming languages.
How do I make that thing highlighted correctly?
Found another possible solution here: https://community.atlassian.com/t5/Confluence-questions/How-can-I-escape-curly-braces-within-code-tags/qaq-p/29147#M4940
Try
{ for {
and
} for }
My solution was to separate the }}} with soft hyphens (https://en.wikipedia.org/wiki/Soft_hyphen).
That way, You can do something like this:
{{{ \}}} # returns { }, code formatted. There is a soft hyphen character between the first and second }.
I'm guessing this comes much too late for Julien, but hopefully any future people seeing this will find this useful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes. Or {code}. But I want to be able to say something like "By default, this method will return {{]}}", but with an empty object, not an empty array.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is now specific programming language support in code blocks. Specify the language in the leading code block as described in the Syntax guide.
Use {code: json} for example to handle those pesky curly braces when pasting json.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you don't need it inline, you can use {noformat}, but you probably know this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.