changeset 4020:b1e192a3651a SOC2008-END

converter doesn't remove first line of preformated text when it's not empty
author Byeongweon [tasyblue@gmail.com]
date Tue, 19 Aug 2008 03:05:36 +0900
parents db5023512482
children e63067d188eb 6502ec387b1f
files MoinMoin/converter/text_html_text_moin_wiki.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/text_html_text_moin_wiki.py	Mon Aug 18 02:27:53 2008 +0900
+++ b/MoinMoin/converter/text_html_text_moin_wiki.py	Tue Aug 19 03:05:36 2008 +0900
@@ -947,8 +947,11 @@
                     # get longest pre tag({{{ or }}}) from content
                     delimiters.extend(re.compile("((?u){+)").findall(i.data))
                     delimiters.extend(re.compile("((?u)}+)").findall(i.data))
-                    # to remove useless line start iteration second line of i.data
-                    for line in i.data.rstrip().split('\n')[1:]:
+                    # when first line is empty, start iteration second line of i.data
+                    data_lines = i.data.rstrip().split('\n')
+                    if data_lines[0].strip() == '':
+                        data_lines = data_lines[1:]
+                    for line in data_lines:
                         if line.strip().startswith('#!'):
                             if bang_args == '':
                                 bang_args = line.strip()