Code snippets in Include Macro have ugly surrounding effects
Asked by David Schor:

When using the Include macro from a source page with code snippets, the target page displays the code snippets with ugly surrounding effects. These effects do not exist in the source.

Is there a way to eliminate these effects?

Thank you very much!

![ConfluenceIncludeMacroCodeSnippetIssue.png](/t5/image/serverpage/image-id/156274iC9A6DC7623EDD775/image-size/large?v=v2&px=999 "ConfluenceIncludeMacroCodeSnippetIssue.png")


Answers:
author: Bojun Lin
body: This is still not fixed? ...


author: Jessica
body: Hi David,  

Hope you're doing well! Welcome to the Atlassian Community. :D

While checking the behavior you mentioned about the code snippet macro, I could notice not only the surroundings were different, but the whole "box".  

It seems the content there is not being rendered correctly from the new editor to another page, because the Include page macro is not being able to maintain the same styling from the new editor and is show the legacy editor format instead, as seen on this bug:  

* [Code Snippet macro does not display the same styling on using Include page macro](https://jira.atlassian.com/browse/CONFCLOUD-71644)

Also, the code macro is not displaying the same styling, as it happens with the example you provided when it is used inside another macro, which is the case of using it to show on another page using the include page macro:

* [Code macro does not display the same styling when used inside another macro](https://jira.atlassian.com/browse/CONFCLOUD-72431)

<br />

At this moment, we don't have a workaround for this bug, so our recommendation, for now, would be to copy the Code snippet/macro and inserting it directly on the page instead.  

I hope this helps to clarify why this is happening on your page with the macro.  

If there is anything else we can help with or clarify, please let us know!  

Kindest Regards,  
Jessica

comments: author: David Schor
body: Hi Jessica, thank you for responding. copying and pasting the snippet directly is unsatisfactory. The purpose for using the "Include" macro is reuse of the same material multiple times in the knowledge base while maintaining one source for it. The pages include 1-3 code snippets in various locations on the pages. Copying and pasting the snippets outside the macro removes context most of the time, and may again result in the need to update a snippet multiple times.

Please don't rest on this workaround.

Thank you,

David


author: Jessica
body: Thank you for your reply, [@David Schor](/t5/user/viewprofilepage/user-id/4483830)  

Yeah, at this moment we don't have a valid workaround and we understand completely how annoying it could be, as the styling is not matching the one from the source page there.  

That would be a suggestion just in case you really would need it to look exactly as it was on the source page since we don't have a valid workaround for the include page macro.  

We're sorry that you have run into this bug. For now, we don't have an official ETA for a fix for this one, but we highly recommend adding yourself as a watcher of the report, to receive the updates on the same.  

Thank you again for your honest feedback, David.  

Kindest Regards,  
Jessica


Tags: cloud

confluence-cloud