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
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.
I added
.code-keyword {
color
:
#222277
; }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.