From 6040154bde912222528cd84b0d8bec7bc60bb65a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Tue, 15 Feb 2011 01:16:18 +0100 Subject: More of this w3c stuff --- templates/page.mako | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'templates/page.mako') diff --git a/templates/page.mako b/templates/page.mako index aa2aa51..1a43d49 100644 --- a/templates/page.mako +++ b/templates/page.mako @@ -1,4 +1,5 @@ <%! + trans = {ord(" "):u"-", ord("/"):"-", ord("(") : None, ord(")"):None} title = "" uses_toc = False %> @@ -24,15 +25,16 @@ ${page_text} <% if self.attr.uses_toc: c = capture(caller.body) - name = c.replace(" ", "_").replace("/", "_").lower() + name = c.translate(trans) tlist = getattr(self.attr, "tlist", []) tlist.append((str(name), str(c))) self.attr.tlist = tlist + id_tag = "id=\"%s\"" % name else: - name = "#" + id_tag = '' %> - <${tag}>» ${caller.body()} + <${tag}>» ${caller.body()} <%def name="toc()"> -- cgit v1.2.3