crayon-syntax-highlighter
crayon-syntax-highlighter copied to clipboard
Rendering shortcodes inside the code
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?