comparison MoinMoin/converter/text_html_text_moin_wiki.py @ 2855:f003d451be90

text_html_text_moin_wiki: br for empty cell of OOo to gui replaced by whitespace at process_table_data
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sun, 23 Sep 2007 08:19:55 +0200
parents fd6ad1421faf
children 244f9e89fb15
comparison
equal deleted inserted replaced
2854:97c5fba1c6ae 2855:f003d451be90
743 if name in ('h1', 'h2', 'h3', 'h4', 'h5', 'h6', ): # headers are not allowed here (e.g. inside a ul li), 743 if name in ('h1', 'h2', 'h3', 'h4', 'h5', 'h6', ): # headers are not allowed here (e.g. inside a ul li),
744 text = self.node_list_text_only(node.childNodes).strip() # but can be inserted via the editor 744 text = self.node_list_text_only(node.childNodes).strip() # but can be inserted via the editor
745 self.text.append(text) # so we just drop the header markup and keep the text 745 self.text.append(text) # so we just drop the header markup and keep the text
746 return 746 return
747 747
748 # if we get br from e.g. cut and paste from OOo to the gui it should be appended as <<BR>>
749 if name == 'br':
750 self.text.append(' <<BR>> ')
751 return
752
753 func = getattr(self, "process_%s" % name, None) 748 func = getattr(self, "process_%s" % name, None)
754 if func: 749 if func:
755 func(node) 750 func(node)
756 return 751 return
757 752
1046 self.text.append(self.white_space) 1041 self.text.append(self.white_space)
1047 found = True 1042 found = True
1048 if not found: 1043 if not found:
1049 for i in node.childNodes: 1044 for i in node.childNodes:
1050 if i.nodeType == Node.ELEMENT_NODE: 1045 if i.nodeType == Node.ELEMENT_NODE:
1051 self.process_inline(i) 1046 if name == 'br':
1052 found = True 1047 # if we get a br for an empty cell from e.g. cut and paste from OOo
1048 # to the gui it should be appended as white_space.
1049 self.text.append(self.white_space)
1050 found = True
1051 else:
1052 self.process_inline(i)
1053 found = True
1053 elif i.nodeType == Node.TEXT_NODE: 1054 elif i.nodeType == Node.TEXT_NODE:
1054 data = i.data.strip('\n').replace('\n', ' ') 1055 data = i.data.strip('\n').replace('\n', ' ')
1055 if data: 1056 if data:
1056 found = True 1057 found = True
1057 self.text.append(data) 1058 self.text.append(data)