Code block macros defaulting to last used Syntax Highlighting and Theme - Confluence 4

Using the WYSIWIG editor in Confluence 4, I am finding that all my code blocks default to whatever settings I use on the most recent code block.

For example, I have some code blocks for file system navigation. I want those to be one type of syntax highlighting and theme. I also have code blocks that are the internal contents of a file, and I want those to be a different type of syntax highlighting and theme.

What I find is that ALL the code blocks on the page will use whatever syntax highlighting and theme that I apply to the last code block on the page, instead of the syntax and theme that they were originally set for. If you look at the code blocks in the editor, the language and theme have not changed, but how they are displayed has changed.

Is this the expected behavior? I would very much like to be able to specify the syntax and theme for each code block at an individual level, instead of it being global.

1 answer

1 vote
Joe Clark Atlassian Team Nov 01, 2011

It's a known bug in the code macro - it's not possible to have code macros with multiple styles on the one page - https://studio.plugins.atlassian.com/browse/NCODE-82

Is there a way to reopen that bug so that it's no longer in Resolved/Won't Fix status, or to at least document this somewhere that isn't hidden in a bug report? That bug didn't show up in my searches for this issue, nor is it mentioned here: http://confluence.atlassian.com/display/DOC/Code+Block+Macro

I'm also having the same issue as many of the current commentors on that page are having, where all my indentation gets removed when pasting into the code block. Is there a bug report open for this?

Joe Clark Atlassian Team Nov 03, 2011

I've re-opened https://studio.plugins.atlassian.com/browse/NCODE-82 to track it again.

I think there are some white-space/indenting related bug reports in the NCODE project - try having a search and see if you can find any.

My problem is slightly different -- I am getting different indenting of code blocks on the same page, and it is never the way I want it. This is a very undesirable loss of functionality in the WYSIWYG editor.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 29, 2018 in New to Confluence

How to use Confluence Cloud for stakeholder management

Most of us don’t need much convincing that stakeholder management is important. It just makes sense that keeping everyone in-the-know on projects and assigning clearly defined roles is key to having ...

1,104 views 1 6
Read article

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