Skip to content
Snippets Groups Projects
Commit 018d40eb authored by Mike Bayer's avatar Mike Bayer
Browse files

escaping for section names

parent eba49066
No related branches found
No related tags found
No related merge requests found
......@@ -135,7 +135,7 @@ A tag that is familiar from other template languages, %include is a regular joe
hello world
<%include file="footer.html"/>
#### <%def>
The `%def` tag defines a Python function which contains a set of content, that can be called at some other point in the template. The basic idea is simple:
......
......@@ -4,7 +4,7 @@ defines a pickleable, recursive "table of contents" datastructure.
TOCElements define a name, a description, and also a uniquely-identifying "path" which is
used to generate hyperlinks between document sections.
"""
import time
import time, cgi
toc_by_file = {}
toc_by_path = {}
......@@ -13,7 +13,7 @@ filenames = []
class TOCElement(object):
def __init__(self, filename, name, description, parent=None, version=None, last_updated=None, doctitle=None, **kwargs):
self.filename = filename
self.name = name
self.name = cgi.escape(name, True)
self.description = description
self.parent = parent
self.content = None
......@@ -24,7 +24,7 @@ class TOCElement(object):
self.version = version
self.doctitle = doctitle
(self.path, self.depth) = self._create_path()
#print "NEW TOC:", self.path
print "NEW TOC:", self.path
for key, value in kwargs.iteritems():
setattr(self, key, value)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment