Stacks API

Come build with us.
Stacks API v13 for Stacks 5.0


  <   Templates Variable Reference


This content is open source. You can edit it and submit a pull request on GitHub.
This page is generated from this file.


© . YourHead Software all rights reserved.

String Escaping

String Escaping

Stacks provides access to the RapidWeaver string escaping API. You can specify a specific string escaping format whenever you template replace a string from an “input” control (a text box).

NB: The specific behavior of these encodings is controlled by Rapidweaver, not Stacks.

String Escape Types

Example 1: showing various outputs using various encodings

We start this example with a text control id=textInput containing the following text with some special characters

this is a test " ' < > $

If we out the text with the various encodings like this:

text (default):   %id=textInput%
text (JS):        %id=textInput -encodeJS%
text (PHP):       %id=textInput -encodePHP%
text (HTML):      %id=textInput -encodeHTML%
text (Attribute): %id=textInput -encodeHTMLAttribute%
text (XML):       %id=textInput -encodeXML%
text (Filename):  %id=textInput -encodeFile%

This output will be produced:

text (default):   this is a test " ' < > $
text (JS):        this is a test " \' < > $
text (PHP):       this is a test " \' < > $
text (HTML):      this is a test &#34; &#39; &#60; &#62; $
text (Attribute): this is a test &#34; &#39; &#60; &#62; $
text (XML):       this is a test &#34; &#39; &#60; &#62; $
text (Filename):  this-is-a-test-0022-0027-003C-003E-0024
© . YourHead Software all rights reserved.