^encode( data )^

Tinderbox Icon

Code Type:   Export Mark-up
Code Scope of Action:   item

^encode( data )^

translates special character such as "<" and ">" contained in the data into entities before exporting them.

RSS and Atom syndication feeds with embedded mark-up tags — such as &lt;b&gt; or &lt;p&gt; — need to convert the tags into entities; <b> becomes &amp;lt;b&gt; .

As of v2.4.0 ^encode recognises quotation marks. Single or double quotes that enclose the entire (data) string are stripped; otherwise, double quote marks are encoded.


^encode(<b>)^ exports &lt;b&gt; .

^encode(^text^)^ exports the text of the node to HTML and then encodes that text

^encode(^get(Author)^)^ encodes whatever is stored in the user attribute "Author"

^encode(Ångstrom)^ returns &Aring;ngstrom.

Up: Item-based
Previous: ^do( theMacro [,argument, anotherArgument, etc.] )^  Next: ^endsWith( target, data )^ 

[Last updated: 14 Dec 2009, using v5.0]

Google search aTbRef for:  

Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]

Creative Commons License

Made with Tinderbox