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())
# Navbar
print '<div class="nav">'
- print link_tag('FrontPage', relative_url(site_icon or 'Home'), 'navlink')
+ print link_tag('FrontPage', site_icon or 'Home', 'navlink')
if name:
print ' <b>' + link_tag('?fullsearch=' + name, text, 'navlink') + '</b> '
else:
if text is None:
text = params # default
elif img_re.match(text):
- text = '<img border="0" src="' + text + '" />'
+ text = '<img border="0" src="' + relative_url(text) + '" alt="' + text + '" />'
if not link_class:
if is_external_url(params):
return link_inline(name, name)
def _html_repl(self, word):
+ if not self.in_html and word.startswith('<div'): word = '</p>' + word
self.in_html += 1
return word; # Pass through
def _htmle_repl(self, word):
self.in_html -= 1
+ if not self.in_html and word.startswith('</div'): word += '<p>'
return word; # Pass through
def _ent_repl(self, s):