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
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
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
The new version corrects the issue. Thanks!