Strip leading slashes in directory headers
authorBernie Innocenti <bernie@codewiz.org>
Mon, 3 Aug 2009 13:50:47 +0000 (15:50 +0200)
committerBernie Innocenti <bernie@codewiz.org>
Mon, 3 Aug 2009 13:50:47 +0000 (15:50 +0200)
geekigeeki.py

index 2fb90303413158f3dcd21236f1d3f47fad84018d..52010d6d33a1e0cd45e3c5033454be994b8dede6 100755 (executable)
@@ -337,6 +337,7 @@ def send_footer(mod_string=None):
         cgi.print_arguments()
         cgi.print_form(form)
         cgi.print_environ()
+        #FIXME link_inline("sys/footer")
     print('''
 <div id="footer"><hr />
 <p class="copyright">
@@ -556,7 +557,7 @@ class WikiFormatter:
             | (?P<url>   (http|https|ftp|mailto)\:[^\s'\"]+\S)
             | (?P<email> [-\w._+]+\@[\w.-]+)
 
-            # Lists, divs, spans
+            # Lists, divs, spans and inline objects
             | (?P<li>    ^\s+[\*\#]\s+)
             | (?P<pre>   \{\{\{|\s*\}\}\})
             | (?P<inl>   \{\{([^\s\|]+)(?:\s*\|\s*([^\]]+)|)\}\})
@@ -645,7 +646,7 @@ class Page:
     def format_dir(self):
         out = '== '
         pathname = ''
-        for dirname in self.page_name.split('/'):
+        for dirname in self.page_name.strip('/').split('/'):
             pathname = (pathname + '/' + dirname) if pathname else dirname
             out += '[[' + pathname + '|' + dirname + ']]/'
         out += ' ==\n'