Back to index

moin  1.9.0~rc2
Classes | Functions
fckeditor Namespace Reference

Classes

class  FCKeditor

Functions

def escape

Detailed Description

FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2009 Frederico Caldeira Knabben

== BEGIN LICENSE ==

Licensed under the terms of any of the following licenses at your
choice:

 - GNU General Public License Version 2 or later (the "GPL")
   http://www.gnu.org/licenses/gpl.html

 - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
   http://www.gnu.org/licenses/lgpl.html

 - Mozilla Public License Version 1.1 or later (the "MPL")
   http://www.mozilla.org/MPL/MPL-1.1.html

== END LICENSE ==

This is the integration file for Python.

Function Documentation

def fckeditor.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 29 of file fckeditor.py.

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

Here is the caller graph for this function: