Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do you add in-line comments to code snippets?

Harold Zavarce October 11, 2020

I'm trying to comment on a code snippet, but the option is greyed out.

I can do in-line comments on text but not on the actual code snippet/block.

Thank you!

2 answers

1 accepted

0 votes
Answer accepted
Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 12, 2020

Yes, that is expected behavior. You only options are to add comments above the code block, or actually edit the code and insert comments in the code using the code syntax.

Harold Zavarce October 12, 2020

Is this something that might be changed in the future, having the ability to do in-line comments on specific lines of code?

A bit of context:
I'm building technical documentation that requires to be reviewed and improved, having in-line comments in the code would be optimal.

Like Kellie Freeman likes this
Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 12, 2020

Well don't hold your breath. ;-) This issue was reported under CONFSERVER-36415  in 2015, and its current status is shows as "not being considered". So it is open, but no plans to fix.

Harold Zavarce October 12, 2020

Thank you for your quick reply! Looks like I will have to find another solution for my team's needs.

Tom Gagne July 26, 2021

So.. almost one year later, did you find a solution?

K Langford December 9, 2021

As clumsy as it may sound, I've been doing this for a while with the Excerpt macro. Drop the macro in, set it to hidden, and add whatever notes you wish for the next developer. Not the intent of the Excerpt macro, but it did solve the problem for me.

0 votes
Tamas Csikos
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 4, 2022

For those who still looking for answers, I can recommend a midway solution with Markup:
https://confluence.atlassian.com/doc/confluence-wiki-markup-251003035.html

It doesn't support markdown highlighting, but can create a preformatted block, which can be commented.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events