• Hi! Great plugin you did.

    I noticed that it also pops up on the inline coded words which is unnecessary for me. I substitued the “cide” selector for the embeding code block class, “wp-block-code”.

    But it will be reset once you release a new update. Can I customize this forever? Or at least get notified of the new version to manually change the selector?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author treeflips

    (@treeflips)

    I don’t see why you can’t put some custom CSS in your theme or customizer and use !important.

    If I may, I think I understood what @artildo meant because I just ran into the same issue.

    In the description of the plugin you say:

    Simple plugin that automatically copies content in pre and code tags to clipboard (when clicked)

    But in fact your code uses this line to apply the button:

    document.querySelectorAll("code").forEach(function(element)

    That is, you currently apply a ‘Click to copy’ button to the content of ‘code’ tags, but not to ‘pre’ tags.

    This becomes problematic when using inline code. The click-to-copy button becomes distracting when applied to inline code. However, it is needed in larger code sections, which by convention are wrapped by ‘pre’.

    So it would be more useful if your code used the following to apply:

    document.querySelectorAll("pre").forEach(function(element)

    This has the advantage of allowing code copying in blocks while leaving inline code clear of the copy button.

    If I understand correctly, @artildo made this change directly in the plugin code, as did I. But he was worried about plugin updates overriding his manual changes.

    Thread Starter artildo

    (@artildo)

    @treeflips sorry, didn’t see your reply. I meant, that the plugin is firing also over the inline code. That’s actually not convenient. And cannot be fixed with simple CSS tricks.

    @marashmallow Yes, you got me correctly. Had to change the plugin code, until the next plugin update.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘I changed selector for coping – but it will be overwritten with updates’ is closed to new replies.