comparison MoinMoin/converter/text_html_text_moin_wiki.py @ 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 73e64899e511
children e5a5b2797a6a 07862b0663fd
comparison
equal deleted inserted replaced
4019:db5023512482 4020:b1e192a3651a
945 for i in node.childNodes: 945 for i in node.childNodes:
946 if i.nodeType == Node.TEXT_NODE: 946 if i.nodeType == Node.TEXT_NODE:
947 # get longest pre tag({{{ or }}}) from content 947 # get longest pre tag({{{ or }}}) from content
948 delimiters.extend(re.compile("((?u){+)").findall(i.data)) 948 delimiters.extend(re.compile("((?u){+)").findall(i.data))
949 delimiters.extend(re.compile("((?u)}+)").findall(i.data)) 949 delimiters.extend(re.compile("((?u)}+)").findall(i.data))
950 # to remove useless line start iteration second line of i.data 950 # when first line is empty, start iteration second line of i.data
951 for line in i.data.rstrip().split('\n')[1:]: 951 data_lines = i.data.rstrip().split('\n')
952 if data_lines[0].strip() == '':
953 data_lines = data_lines[1:]
954 for line in data_lines:
952 if line.strip().startswith('#!'): 955 if line.strip().startswith('#!'):
953 if bang_args == '': 956 if bang_args == '':
954 bang_args = line.strip() 957 bang_args = line.strip()
955 else: 958 else:
956 content_buffer.extend([line, self.new_line]) 959 content_buffer.extend([line, self.new_line])