We are discussing algoritmic complexity in one of our JIRA issues and I want to write something like this:
O(n<sup>2</sup>) or O(n)
However, JIRA superscript tags don't work for me (there is O(n^2^) in the output) and when I write O(n), it converts it to some stupid emoticon.
How do I write those things in JIRA wiki markup? Can I insert inline HTML? Can I disable smilies?
You just nees a space in front of the ^ - so this will work O(n ^2^)
That creates O(n <sup>2</sup>), not O(n<sup>2</sup>). Does it always work like that, that wiki formatting characters must be prepended by a space? Are the exact rules described somewhere?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just saw the second part.simply escape the brackets O\(n\)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is probably the best resource - although it doesn't say anything about spaces - https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've seen that but that is really very imprecise (it is a quick user guide rather than full documentation on all the rules). I'd be much happier if the markup was Markdown but I can that can't be intergrated with JIRA, can it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
See my answer, it solves the space problem (between 'n' and '2').
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Like Björn Shad said below, enforce markup recognition by putting the markup in braces : n{^}2^
The opposite is \^ .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Obviously you need to have something not being a letter in front of the caret (superscript) or tilde (subscript) ... and many HTML entities exist. I would suggest &zwj
; or the zero-wdith non-breakable space 
(which does not have a nice entity reference).
Update: You can enforce markup recognition by putting caret or tilde into curly braces: n{^}2^.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Borek,
Here you have: O(n^2^), renders as O(n<sup>2</sup>); the trick is to add the backspace HTML secuence in between the 'n' and the first caret.
To have n to the power of 2 you will need to write n^2^, now this doesn't work because the first caret is just after the 'n' and it needs to be after a space (or some other entities, unspecifed in JIRA's documentation). If you add a space between the 'n' and the first caret it works, but it is rendered as is, with the unwanted space in-between.
I did try several HTML codes but just the backspace ('') works. Don't ask my why becuase I don't fully understand the behaivor of the renderer, my guess is that this combination is a valid one to activate the superscript secuence.
Later, I did try with other html codes and found that the Delete char (#127), works in the same way that the backspace does (#08). Here you have 2 samples of writing the quadratic function. I found the same problem to put the 'X' bold, and solve it in the same way of the superscript.
A) Using backspace #08:
a*X*^2^ ± b*X* ± c = 0, a ≠ 0
It's rendered as: aX<sup>2</sup> ± bX ± c = 0, a ≠ 0
B) Using delete #127:
a*X*^2^ ± b*X* ± c = 0, a ≠ 0
It's rendered as: aX<sup>2</sup> ± bX ± c = 0, a ≠ 0
Lorenzo,
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.