Makes a preformatted block of code with syntax highlighting. All the optional parameters of {panel} macro are valid for {code} too. The default language is Java but you can specify others too, including ActionScript, Ada, AppleScript, bash, C, C#, C++, CSS, Erlang, Go, Groovy, Haskell, HTML, JavaScript, JSON, Lua, Nyan, Objc, Perl, PHP, Python, R, Ruby, Scala, SQL, Swift, VisualBasic, XML and YAML.
Example:
{code:title=Bar.java|borderStyle=solid}
// Some comments here
public String getFoo()
{
return foo;
}
{code}
{code:xml}
<test>
<another tag="attribute"/>
</test>
{code}
Best Answer
Try Visual editing.
As a JIRA administrator, you have to enable this feature in
System
>User interface
>rich text editor
. This should provide two buttons at the bottom of the description field, that allow you to switch betweenText
andVisual
mode.Entering Visual mode shows the preview you're looking for.
See JIRA Core documentation for further details.