up: ZUT     index Zimbu documentation

CLASS ZUT.Html EXTENDS ZUT.Base @public

summary

     

A string that is properly formatted HTML.

This is used to ensure proper HTML escaping.

$add(text) ZUT.Base @public  Add text to the Html, it will be HTML-escaped.
$addText(text) ZUT.Html @public  Add text to the Html, it will be conservatively HTML-escaped.
$add(html) ZUT.Html @public  Add html to this Html. Does not apply any escaping.
$add(url) ZUT.Html @public  Add url to this Html. It will show up as plain text.
$addData(html) @public  Inside pre and title do escape html
$addData(text) @public  Inside pre and title escape string like in Html.
$addData(text) @public  Inside pre and title escape Url like in Html.
$addAttributes(attributes) @public  Inside a tag, add Attributes directly.
$addCss(style) @public  Inside a style tag, add CSS directly.
 
fromSafeString(safeContent) ZUT.Html @public  Create a ZUT.Html object from a string that contains safe, already escaped HTML.
 
Inherited from ZUT.Base:
NEW() @public 
$addUNESCAPED(safeContent) ZUT.Base @public  Add safeContent to the section, it will not be escaped.
$add(number) ZUT.Base @public  Add number to the item as a string.
$add(number) ZUT.Base @public  Add number to the item as a string.
$ToString() string @public  Return the concatenated result.
 

members (alphabetically)

     

FUNC $add(string text) ZUT.Base @public

     

Add text to the Html, it will be HTML-escaped.

FUNC $add(ZUT.Html html) ZUT.Html @public

     

Add html to this Html. Does not apply any escaping.

FUNC $add(ZUT.Url url) ZUT.Html @public

     

Add url to this Html. It will show up as plain text.

PROC $addAttributes(ZUT.Attributes attributes) @public

     

Inside a tag, add Attributes directly.

PROC $addCss(ZUT.Css style) @public

     

Inside a style tag, add CSS directly.

PROC $addData(ZUT.Html html) @public

     

Inside pre and title do escape html

PROC $addData(string text) @public

     

Inside pre and title escape string like in Html.

PROC $addData(ZUT.Url text) @public

     

Inside pre and title escape Url like in Html.

FUNC $addText(string text) ZUT.Html @public

     

Add text to the Html, it will be conservatively HTML-escaped.

shared (alphabetically)

     

FUNC fromSafeString(string safeContent) ZUT.Html @public

     

Create a ZUT.Html object from a string that contains safe, already escaped HTML.

USE WITH CARE: HTML that is not properly escaped can create an XSS vulnerability!

license

      Copyright 2014 Bram Moolenaar All Rights Reserved.

      Licensed under the Apache License, Version 2.0. See the LICENSE file or obtain a copy at: http://www.apache.org/licenses/LICENSE-2.0