return re.sub(' ', '-', re.sub('[^a-z0-9_ ]', '', s.lower()).strip())
def humanlink(s):
- return re.sub(r'([^:/\.]+)(?:\.[^/:]+|)$', r'\1', s.replace('_', ' '))
+ return re.sub(r'(?:.*[/:]|)([^:/\.]+)(?:\.[^/:]+|)$', r'\1', s.replace('_', ' '))
# Split arg lists like "blah| blah blah| width=100 | align = center",
# return a list containing anonymous arguments and a map containing the named arguments
+ ' from ' + cgi.escape(get_hostname(remote_host()))
+ '</b></p>'))
print('<div class="editor"><form name="editform" method="post" enctype="multipart/form-data" action="%s">' % relative_url(self.page_name))
- print('<input type="hidden" name="edit" value="%s">' % (self.page_name))
+ print('<input type="hidden" name="a" value="edit" /><input type="hidden" name="q" value="' + self.page_name + '" />')
print('<input type="input" id="editor" name="changelog" value="Edit page %s" accesskey="c" /><br />' % (self.page_name))
print('<textarea wrap="off" spellcheck="true" id="editor" name="savetext" rows="17" cols="100" accesskey="e">%s</textarea>' \
% cgi.escape(preview or self.get_raw_body(default='')))