Part 3: Advanced Stuff

Escaping injections

If you want to write about Nzymes injections, like I did in this document, you need a way to tell Nzymes that it has to ignore some injections. You do it by starting an injection with two braces instead of one. When Nzymes finds an escaped injection, it removes the additional brace and ignores the rest.

Example.
I have a ´hello-world´ custom field on this post, and it contains ´Hello, World!´.
I inject it like ´{[ .hello-world ]}´ to produce ´Hello, World!´.

Notice that (1) the first ´Hello, World!´ above is written into the content, while the second one is transcluded and (2) the shown injection reads like a non escaped injection but I wrote it like ´{{[ .hello-world ]}´. (If you wonder, I wrote this one with three braces.)

To make the manual escaping / automatic unescaping work as expected, Nzymes will always remove one brace from every occurrence of the opening tag on an injection which happens to have more than one brace. That means that you cannot really write a spare opening tag with two braces and expect it to read with two braces. These chars ´{[´ do not make an injection, but they certainly do make an opening tag of a possible injection so Nzymes always unescapes it. (If you wonder, I wrote this one with two braces.)


{[ @enzymes3-toc-left:post_content ]}{[ @enzymes3-toc-right:post_content ]}
Nzymes | WordPress Plugin
{[ @nzymes.copyright ]}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.