pg.save(form['file'].file.read())
else:
pg.save(form['savetext'].value.replace('\r\n', '\n'))
- pg.send_page()
+ pg.format()
elif 'cancel' in form:
pg.msg_text = 'Editing canceled'
pg.msg_type = 'notice'
- pg.send_page()
+ pg.format()
else: # preview or edit
text = None
if 'preview' in form:
+ r"|(?P<hurl>\[\[([^\s\|]+)(?:\s*\|\s*([^\]]+)|)\]\])"
# Inline HTML
- + r"|(?P<html><(/|)(div|span|iframe|form|input))"
+ + r"|(?P<html><(/|)(br|hr|div|form|iframe|input|span))"
+ r"|(?P<ent>[<>&])"
# Auto links
else:
send_guru("Read access denied by ACLs", "notice")
- def send_page(self):
+ def format(self):
page_name = None
if self.can_write():
page_name = self.page_name
if file_re.match(query):
if word_re.match(query):
- Page(query).send_page()
+ Page(query).format()
else:
from mimetypes import MimeTypes
type, encoding = MimeTypes().guess_type(query)