X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=geekigeeki.py;h=f6ba26c967419f5c219d98d313bdc19932630883;hb=4e1ebf231d757ce8887705fe2a271c68a2eed1e4;hp=79f99efcd292e67034554823a04ca557aa1a19ff;hpb=2048d6cc1d4792f816b2204554984c15fb3d7886;p=geekigeeki.git
diff --git a/geekigeeki.py b/geekigeeki.py
index 79f99ef..f6ba26c 100755
--- a/geekigeeki.py
+++ b/geekigeeki.py
@@ -78,7 +78,7 @@ def relative_url(pathname, privileged=False):
else:
url = script_name()
pathname = url + '/' + pathname
- return pathname
+ return cgi.escape(pathname, quote=True)
def permalink(s):
return re.sub(' ', '-', re.sub('[^a-z0-9_ ]', '', s.lower()).strip())
@@ -143,7 +143,7 @@ def send_title(name, text="Limbo", msg_text=None, msg_type='error', writable=Fal
# Navbar
print '
'
- print link_tag('FrontPage', relative_url(site_icon or 'Home'), 'navlink')
+ print link_tag('FrontPage', site_icon or 'Home', 'navlink')
if name:
print '
' + link_tag('?fullsearch=' + name, text, 'navlink') + ' '
else:
@@ -180,7 +180,7 @@ def link_tag(params, text=None, link_class=None, privileged=False):
if text is None:
text = params # default
elif img_re.match(text):
- text = '
'
+ text = '
'
if not link_class:
if is_external_url(params):
@@ -287,9 +287,10 @@ def handle_edit(pagename):
text = form['savetext'].value
pg.send_editor(text)
+# Used by macros/WordIndex and macros/TitleIndex
def make_index_key():
links = map(lambda ch: '
%s' % (ch, ch), 'abcdefghijklmnopqrstuvwxyz')
- return '
'+ ' | '.join(links) + ''
+ return '
'+ ' | '.join(links) + '
'
def page_list(dirname = None, re = word_re):
return sorted(filter(re.match, os.listdir(dirname or data_dir)))
@@ -402,11 +403,13 @@ class WikiFormatter:
return link_inline(name, name)
def _html_repl(self, word):
+ if not self.in_html and word.startswith('
'
return word; # Pass through
def _ent_repl(self, s):