• Resolved mikecargal

    (@mikecargal)


    I have the following on one of my pages:

    [copy_inline text=”background-color: var(–wp–preset–color–background);” display=”background-color: var(–wp–preset–color–background);” ]

    However, the content copied to the clipboard converts all the — to –

    Is there some way to avoid this conversion?

    I’m on a Mac using Safari (in case that matters) (Just tested in Chrome and it does the same thing)

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Clipboard Agency

    (@clipboardagency)

    Hi @mikecargal,

    Thank you for reporting this issue! You’re correct – this is happening.

    The cause: WordPress has a built-in function called wptexturize() that automatically converts — to – (en-dash) and — to — (em-dash). This conversion happens before the shortcode processes your content.

    Workaround for now, Use the - for the -.

    E.g. Use HTML entities in your shortcode:

    [copy_inline text="background-color: var(--wp--preset--color--background);" display="background-color: var(--wp--preset--color--background);" ]

    This uses -- which will be decoded as -- when copied, while the display can show the visual dashes.

    I’m adding a fix to automatically handle this in the next update so you won’t need workarounds.

    Thanks for helping improve the plugin!

    • This reply was modified 2 months, 1 week ago by Clipboard Agency. Reason: update shortcode
    Plugin Author Clipboard Agency

    (@clipboardagency)

    Hi @mikecargal,

    Thank you for reporting this! The issue has been fixed in the upcoming v5.0.0 release.

    The problem: WordPress’s wptexturize() function automatically converts — to – (en-dash), which breaks CSS custom properties like var(–wp–preset–color–background).

    The fix: The plugin now automatically detects and fixes this conversion specifically inside var() functions. Your shortcode will now copy the correct — double hyphens.

    No workaround needed – just update to v5.0.0 when released!

    Thanks for helping improve the plugin!

    Best regards,
    Support Team

    Thread Starter mikecargal

    (@mikecargal)

    Tried the workaround. It didn’t decode the html encoded entities, so my clipboard contains the - characters.

    Interestingly, they are decoded when I try to just paste it into this message box, so you have to be careful where you test it.

    Hopefully, the new release is coming soon

    Thread Starter mikecargal

    (@mikecargal)

    The new version corrects the issue. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.