Back to index

moin  1.9.0~rc2
Public Member Functions
MoinMoin.converter.text_html_text_moin_wiki.strip_whitespace Class Reference
Inheritance diagram for MoinMoin.converter.text_html_text_moin_wiki.strip_whitespace:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.converter.text_html_text_moin_wiki.strip_whitespace:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def visit_element
def do
def visit_node_list
def visit
def visit_attribute
def visit_text
def visit_cdata_section

Detailed Description

Definition at line 435 of file text_html_text_moin_wiki.py.


Member Function Documentation

def MoinMoin.converter.text_html_text_moin_wiki.visitor.do (   self,
  tree 
) [inherited]

Reimplemented in MoinMoin.converter.text_html_text_moin_wiki.convert_tree.

Definition at line 403 of file text_html_text_moin_wiki.py.

00403 
00404     def do(self, tree):
00405         self.visit_node_list(tree.childNodes)

Here is the call graph for this function:

Here is the caller graph for this function:

def MoinMoin.converter.text_html_text_moin_wiki.visitor.visit (   self,
  node 
) [inherited]

Definition at line 410 of file text_html_text_moin_wiki.py.

00410 
00411     def visit(self, node):
00412         nodeType = node.nodeType
00413         if node.nodeType == Node.ELEMENT_NODE:
00414             return self.visit_element(node)
00415         elif node.nodeType == Node.ATTRIBUTE_NODE:
00416             return self.visit_attribute(node)
00417         elif node.nodeType == Node.TEXT_NODE:
00418             return self.visit_text(node)
00419         elif node.nodeType == Node.CDATA_SECTION_NODE:
00420             return self.visit_cdata_section(node)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 425 of file text_html_text_moin_wiki.py.

00425 
00426     def visit_attribute(self, node):
00427         pass

Here is the caller graph for this function:

Definition at line 431 of file text_html_text_moin_wiki.py.

00431 
00432     def visit_cdata_section(self, node):
00433         pass
00434 

Here is the caller graph for this function:

Reimplemented from MoinMoin.converter.text_html_text_moin_wiki.visitor.

Definition at line 437 of file text_html_text_moin_wiki.py.

00437 
00438     def visit_element(self, node):
00439         if node.localName == 'p':
00440             # XXX: our formatter adds a whitespace at the end of each paragraph
00441             if node.hasChildNodes() and node.childNodes[-1].nodeType == Node.TEXT_NODE:
00442                 data = node.childNodes[-1].data.rstrip('\n ')
00443                 # Remove it if empty
00444                 if data == '':
00445                     node.removeChild(node.childNodes[-1])
00446                 else:
00447                     node.childNodes[-1].data = data
00448             # Remove empty paragraphs
00449             if not node.hasChildNodes():
00450                 node.parentNode.removeChild(node)
00451 
00452         if node.hasChildNodes():
00453             self.visit_node_list(node.childNodes)
00454 

Here is the call graph for this function:

def MoinMoin.converter.text_html_text_moin_wiki.visitor.visit_node_list (   self,
  nodelist 
) [inherited]

Definition at line 406 of file text_html_text_moin_wiki.py.

00406 
00407     def visit_node_list(self, nodelist):
00408         for node in nodelist:
00409             self.visit(node)

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented in MoinMoin.converter.text_html_text_moin_wiki.convert_tree.

Definition at line 428 of file text_html_text_moin_wiki.py.

00428 
00429     def visit_text(self, node):
00430         pass

Here is the caller graph for this function:


The documentation for this class was generated from the following file: