how can I specify the type of code in a code block ?

When I paste code in a code-block can I specify what language the code is in ?

In my specific case some code is detected in the wrong language and the highlighting looks strange.

I still remember the wiki markup ( code:xml , code:sql etc), but there seems to be no equivalent in the 'edit' popup to select the type of code.

2 answers

1 accepted

Are you using the latest version of the plugin? Please check in the Conlfuence Administration if you are using the latest version of the Code Macro Plugin.

I'm using the Confluence 4.1 , with version 2.0.8 of the Code Macro Plugin (from Atlassian)

  • Are all modules enabled?
  • Have you changed something in the configuration of the plugin?

Also, I used to have the 'new code' plugin installed before we upgraded, maybe this is causing issues ?

all 22 modules are enabled


I just installed Confluence 4.1 as well because I thought that the problem might have something to do with the latest version of Confluence. But everything seems to work well in that version as well.

Yes it might well be that the use of the new code macro prior to the upgrade is the culprit here. Unfortunately I'm out of ideas and I can't help you any further. I suggest you report this porblem with Atlassian.



Thanks for checking, I'll contact Atlassian support.

You have to edit the codeblock with the "Edit" Button. In the macro Browser you could change the language (The first dropdown)

what to do if there is no dropdown ?

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

1,008 views 22 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you