Thanks for sharing the link. I tried it and yes it does add a trailing return when pasting a command. However for me the extra return doesn’t execute the command, I’m guess it does for you? I think the return has to be there for formatting, and that you’ll have to modify how the library copies bash commands into the clipboard
Unfortunately it run the command automatically for me, I tried on different systems and different shells.
I don’t think it’s a prismjs problem, I tried on other sites that use it and I don’t see the same problem.
You can try on codepen.
I tried from ubuntu on windows, and on some vps with fedora and ubuntu, I encountered the same problem.
is a problem when I write an example of code with parameters to be modified based on user preferences, if the command starts automatically, the user will use the example parameters, and probably will not work.
The code you gave me solves the problem, initially I didn’t want to solve using javascript, I thought it was a different problem, but for now it’s ok.
thanks a lot
You could tweak your CSS to inherit another language, but you’re best off just adding text to the language field. You’ll always need to add a value because it needs to know how to syntax highlight the code
I would recommend using a CDN if you’re not comfortable editing the theme yourself. However if you’re ok with that then I’d add the JavaScript and CSS into the theme, as you’ll get a slight performance boost from it. Even more so if you’re able to use the theme build process to combine your JavaScript and CSS into single .js and .css files.