Jira Incapable Of Formatting Code Blocks

Max MacLeod
Contributor
December 9, 2024

Even using {code}. It works, then it doesn't. 

Tried pre-formatted, Screenshot 2024-12-09 at 16.24.34.pngScreenshot 2024-12-09 at 16.22.47.pngparagraph and block quotes, and finally {code}. The latter appears to work despite being unable to select the code snippet and encapsulate. Worse still, on further editing the code formatting is lost and the mess reappears. 

This has been a source of daily frustration for years. 

Note that even this community page is incapable of formatting this editing box with the uploaded attachments. Then when I attempt to "Publish" the question using the button below, a warning tells me I will lose unsaved changes and asks if I want to leave.

Screenshot 2024-12-09 at 16.25.43.png

 

Not to mention losing text, the cursor jumping around, and other unpredictable and frustrating behaviour.

1 answer

0 votes
Mirek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 30, 2024

Hi @Max MacLeod 

Interesting topic. 

First of all you need to know that everything that you paste into a field is executing as a request and this might be causing problems. It also might be checked against WAF and other tools to prevent from doing an attack. 

From the screenshots it looks that you are using not ideally formatted code. Is it copied from somewhere or written by you directly on the field? If this is copied keep in mind that this is not working many times as expected. 

If you were using {code} and it is still not working as expected (not seeing that example in the screenshots) .. did you maybe tried {noformat} and see how the code above looks like? This should work similar (jira renders this in a same way) just it is not executed by plugins and with no syntax highlighting.

Suggest an answer

Log in or Sign up to answer