git » wikiri » commit a1cc68e

rstrip() newcontent on save.

author Alberto Bertogli
2007-12-30 06:01:34 UTC
committer Alberto Bertogli
2007-12-30 06:01:36 UTC
parent 7269a70a8b5203008195032670548044aa4b3f33

rstrip() newcontent on save.

To avoid adding newlines every time we edit the page (because it depends
on how the textarea is written in the template pages), rstrip() newcontent
at the moment we save the article.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>

wikiri.cgi +1 -1

diff --git a/wikiri.cgi b/wikiri.cgi
index 1507e62..56db044 100755
--- a/wikiri.cgi
+++ b/wikiri.cgi
@@ -492,7 +492,7 @@ class Article (object):
 	def save(self, newtitle, newcontent):
 		fd = open(data_path + '/' + self.qname, 'w+')
 		fd.write('title: %s\n\n' % newtitle)
-		fd.write(newcontent)
+		fd.write(newcontent.rstrip() + '\n')
 		fd.close()
 
 	def remove(self):