Code block macro issue

Hi All,

When I include an XML code block to a wiki page and export that to PDF, the xml tags don't get nicely highlighted in blue. It looks like a normal block of letters.

How can I fix this issue please?

Thanks

2 answers

I added

.code-keyword { color: #222277; }
To the PDF stylesheet but still the keywords come up in black as normal text.

We hit this problem too. One of my team had a look at the code being generated on the way to the PDF export and he thinks that Confluence strips out the code highlighting intentionally. It's really frustrating because we want to export code with syntax highlighting as well.

Currently we're using a rather weird workaround which involves having two copies of every code example: one to print and one to display in the browser. The printable version is generated outside Confluence with the syntax highlighting explicitly coded into the HTML styling. We added extra styles to our CSS to work with this. Unfortunately, this uses an existing utility of ours and so I cannot tell you what steps you'd need to use to implement something similar. There are quite a few syntax highlighters out there and so you could probably create a similar workaround if this is a real problem for you.

I thought that I'd voted on an issue in Jira for this but cannot find one. The closest information that I can find is here -- which explains why they dropped export of highlighted code in 2010 but not why they haven't done anything since.

I've just raised it as a support issue. I imagine that if more people ask for this then they're more likely to do something about it.

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
Published yesterday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

308 views 4 9
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