git » wikiri » commit 7b47043

Do not count the header-content division as a part of the content

author Alberto Bertogli
2008-11-24 18:04:58 UTC
committer Alberto Bertogli
2008-11-24 18:08:53 UTC
parent ee58e0129cf0a65cda485964c0532fcdc6576c8a

Do not count the header-content division as a part of the content

When loading an article for editing, an extra newline is placed at the top
of the content.

The cause of this is that we count the empty line between an article's
header and content as part of the content.

This patch fixes this by just ignoring it.

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

wikiri.cgi +1 -0

diff --git a/wikiri.cgi b/wikiri.cgi
index b1f5046..dab565d 100755
--- a/wikiri.cgi
+++ b/wikiri.cgi
@@ -610,6 +610,7 @@ class Article (object):
 
 				elif l == '\n' or l == '\r\n':
 					# end of header
+					hdr_lines += 1
 					break
 
 		self._raw_content = ''.join(raw[hdr_lines:])