From: Bernie Innocenti Date: Sat, 2 May 2009 09:44:07 +0000 (+0200) Subject: Fix editing and humanized links X-Git-Tag: v4.0~3 X-Git-Url: https://codewiz.org/gitweb?p=geekigeeki.git;a=commitdiff_plain;h=3cebb905becc61868f9431c2cf8939d1f1cd198e Fix editing and humanized links --- diff --git a/geekigeeki.py b/geekigeeki.py index a36eced..afaebef 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -80,7 +80,7 @@ def permalink(s): 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 @@ -742,7 +742,7 @@ class Page: + ' from ' + cgi.escape(get_hostname(remote_host())) + '

')) print('
' % relative_url(self.page_name)) - print('' % (self.page_name)) + print('') print('
' % (self.page_name)) print('' \ % cgi.escape(preview or self.get_raw_body(default='')))