comparison MoinMoin/converter/mediawiki_in.py @ 1781:90eb2ea82c32

add auto-scroll edit textarea after doubleclick; auto-scroll show page after edit
author Roger Haase <crosseyedpenguin@yahoo.com>
date Mon, 17 Sep 2012 13:06:42 -0700
parents 3de98439f49c
children cba57aaf5bc1
comparison
equal deleted inserted replaced
1780:4a054063fbb0 1781:90eb2ea82c32
180 if key in ('class', 'style', 'number-columns-spanned', 'number-rows-spanned'): 180 if key in ('class', 'style', 'number-columns-spanned', 'number-rows-spanned'):
181 attrib[moin_page(key)] = value 181 attrib[moin_page(key)] = value
182 182
183 element = moin_page.table_body() 183 element = moin_page.table_body()
184 stack.push(element) 184 stack.push(element)
185 lines = _Iter(self.block_table_lines(iter_content)) 185 lines = _Iter(self.block_table_lines(iter_content), startno=iter_content.lineno)
186 element = moin_page.table_row() 186 element = moin_page.table_row()
187 stack.push(element) 187 stack.push(element)
188 preprocessor_status = [] 188 preprocessor_status = []
189 for line in lines: 189 for line in lines:
190 m = self.tablerow_re.match(line) 190 m = self.tablerow_re.match(line)
329 329
330 stack.push(moin_page.list_item()) 330 stack.push(moin_page.list_item())
331 if list_definition: 331 if list_definition:
332 element_label = moin_page.list_item_label() 332 element_label = moin_page.list_item_label()
333 stack.top_append(element_label) 333 stack.top_append(element_label)
334 new_stack = _Stack(element_label) 334 new_stack = _Stack(element_label, iter_content=iter_content)
335 # TODO: definition list doesn't work, 335 # TODO: definition list doesn't work,
336 # if definition of the term on the next line 336 # if definition of the term on the next line
337 splited_text = text.split(':') 337 splited_text = text.split(':')
338 list_definition_text=splited_text.pop(0) 338 list_definition_text=splited_text.pop(0)
339 text = ':'.join(splited_text) 339 text = ':'.join(splited_text)
342 342
343 element_body = moin_page.list_item_body() 343 element_body = moin_page.list_item_body()
344 element_body.level, element_body.type = level, type 344 element_body.level, element_body.type = level, type
345 345
346 stack.push(element_body) 346 stack.push(element_body)
347 new_stack = _Stack(element_body) 347 new_stack = _Stack(element_body, iter_content=iter_content)
348 else: 348 else:
349 new_stack = stack 349 new_stack = stack
350 level = 0 350 level = 0
351 351
352 is_list = list_begin 352 is_list = list_begin
353 iter = _Iter(self.indent_iter(iter_content, text, level, is_list)) 353 iter = _Iter(self.indent_iter(iter_content, text, level, is_list), startno=iter_content.lineno)
354 for line in iter: 354 for line in iter:
355 match = self.block_re.match(line) 355 match = self.block_re.match(line)
356 it = iter 356 it = iter
357 # XXX: Hack to allow nowiki to ignore the list identation 357 # XXX: Hack to allow nowiki to ignore the list identation
358 if match.lastgroup == 'table' or match.lastgroup == 'nowiki': 358 if match.lastgroup == 'table' or match.lastgroup == 'nowiki':
967 elif key == '_old': 967 elif key == '_old':
968 attrib[moin_page.class_] = value.replace('/', ' ') 968 attrib[moin_page.class_] = value.replace('/', ' ')
969 969
970 body = moin_page.body(attrib=attrib) 970 body = moin_page.body(attrib=attrib)
971 971
972 stack = _Stack(body) 972 stack = _Stack(body, iter_content=iter_content)
973 973
974 for line in iter_content: 974 for line in iter_content:
975 match = self.indent_re.match(line) 975 match = self.indent_re.match(line)
976 if match: 976 if match:
977 data = dict(((str(k), v) for k, v in match.groupdict().iteritems() if v is not None)) 977 data = dict(((str(k), v) for k, v in match.groupdict().iteritems() if v is not None))