Back to index

moin  1.9.0~rc2
Classes | Functions
fckoutput Namespace Reference

Classes

class  BaseHttpMixin
class  BaseXmlMixin
class  BaseHtmlMixin

Functions

def escape
def convertToXmlAttribute

Function Documentation

Definition at line 44 of file fckoutput.py.

00044 
00045 def convertToXmlAttribute(value):
00046        if (value is None):
00047               value = ""
00048        return escape(value)

Here is the call graph for this function:

Here is the caller graph for this function:

def fckoutput.escape (   text,
  replace = string.replace 
)
Converts the special characters '<', '>', and '&'.

RFC 1866 specifies that these characters be represented
in HTML as &lt; &gt; and &amp; respectively. In Python
1.5 we use the new string.replace() function for speed.

Definition at line 30 of file fckoutput.py.

00030 
00031 def escape(text, replace=string.replace):
00032        """
00033        Converts the special characters '<', '>', and '&'.
00034 
00035        RFC 1866 specifies that these characters be represented
00036        in HTML as &lt; &gt; and &amp; respectively. In Python
00037        1.5 we use the new string.replace() function for speed.
00038        """
00039        text = replace(text, '&', '&amp;') # must be done 1st
00040        text = replace(text, '<', '&lt;')
00041        text = replace(text, '>', '&gt;')
00042        text = replace(text, '"', '&quot;')
00043        return text

Here is the caller graph for this function: