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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

639 views 21 11
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