crayon-syntax-highlighter icon indicating copy to clipboard operation
crayon-syntax-highlighter copied to clipboard

Rendering shortcodes inside the code

Open dingo-d opened this issue 8 years ago • 0 comments

When writing the shortcode code if you just have, for instance

var gallerysc = '[gallery ids="' + ids + '"]';

Inside your syntaxed code, the gallery shortcode will run in the visual tab. The solution, in the pure WordPress environment is to escape it by placing the right and left angled braces twice

var gallerysc = '[[gallery ids="' + ids + '"]]';

So if you'd write in text tab

<pre>[[gallery ids=""]]</pre>

this will be shown as

[gallery ids=""]

on the front with a gray background around it. But if I place this inside the syntax highlighter, I'll just get two braces properly colored.

Any way around this?

dingo-d avatar Dec 17 '16 19:12 dingo-d