• Resolved PrajwalDesai

    (@prajwaldesai)


    Is there an option to add copy function to the code ?. For example, you hover over the code and it shows Copy option.

    • This topic was modified 5 years, 1 month ago by PrajwalDesai.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter PrajwalDesai

    (@prajwaldesai)

    Just to be clear, this is the one that I am looking for – https://prismjs.com/plugins/copy-to-clipboard/

    Plugin Author Jeff Starr

    (@specialk)

    Hi @prajwaldesai, it’s not a current feature of the plugin but I like the idea. Will add it to the to-do list and try to add in a future plugin update. Thank you for the feedback.

    Plugin Author Jeff Starr

    (@specialk)

    Just to follow up with this, the next version of the plugin adds the “copy to clipboard” plugin for Prism.js. Can be enabled/disabled in the plugin settings. Thanks again @prajwaldesai for the idea.

    Thread Starter PrajwalDesai

    (@prajwaldesai)

    Thanks @specialk, a copy button will make the plugin even best. Do you know how can we change the font type once we insert any code or text between pre, code </pre </code ?

    Plugin Author Jeff Starr

    (@specialk)

    Normally when using either Prism.js or Highlight.js, the library provides the font for any highlighted code snippets. To override that, you could use some custom CSS that targets whichever code snippets, etc.

    Thread Starter PrajwalDesai

    (@prajwaldesai)

    I tried changing the font type in the .css files but it didn’t work. I am working on it..

    Any idea when can we see the plugin update ?. ??

    Plugin Author Jeff Starr

    (@specialk)

    Yeah it can be tricky finding the correct selectors. My guess would be to target language-php or whatever class you are using for your snippets.

    Next version of the plugin should be available in time for WP 5.3, which is scheduled for the 12th of this month, last time I checked.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Add Copy code button’ is closed to new replies.