Get rid of the Copy button in code snippets

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
Vibeke B
Propeller Head
Posts: 73
Joined: Thu Mar 15, 2018 7:14 am
Location: Denmark

Get rid of the Copy button in code snippets

Post by Vibeke B »

Hi!

The Copy button in code snippets is giving us problems. If you use it, it messes up the spaces or tabs or whatever you use. But if you just copy the code from the box, it works fine. So we want to remove the Copy button from all our code snippets. Anyone have a suggestion for doing this in a clever way? Other than just removing the <MadCap:codeSnippetCopyButton />

Thanks!

Kind regards,
Vibeke
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Get rid of the Copy button in code snippets

Post by NorthEast »

You can use CSS to hide the button:

Code: Select all

MadCap|codeSnippetCopyButton
{
	display: none;
}
RStreets
Propeller Head
Posts: 63
Joined: Wed Apr 19, 2017 8:37 am
Location: Cambridge, UK

Re: Get rid of the Copy button in code snippets

Post by RStreets »

Just to note that copying directly from a published code snippet can still cause problems: the leading spaces in indented lines of code are non-breaking spaces and may cause difficulties when working with the pasted code snippet.
Rae Streets (Flare user since 2017, now on Flare 2023; Central user from 2020)
Vibeke B
Propeller Head
Posts: 73
Joined: Thu Mar 15, 2018 7:14 am
Location: Denmark

Re: Get rid of the Copy button in code snippets

Post by Vibeke B »

Thanks for the suggestion for doing it via CSS, great idea. Our previous tests showed that the code worked if you just copied it from the box without using the Copy button, so we will try and go ahead with this solutions.
Post Reply