src/cm/utils/spannifier.py
changeset 473 cefe588b2a2b
parent 464 5a02bfc8aae8
child 502 8ec189cc214d
equal deleted inserted replaced
472:39f17ac0388c 473:cefe588b2a2b
     6 
     6 
     7 def get_text_nodes(soup):
     7 def get_text_nodes(soup):
     8     return soup(text=lambda text:not isinstance(text, Comment))
     8     return soup(text=lambda text:not isinstance(text, Comment))
     9 
     9 
    10 def is_real_text_node(textNode):
    10 def is_real_text_node(textNode):
       
    11     if textNode.string == "\n":
       
    12       return False
    11     return not textNode.findParent('style') 
    13     return not textNode.findParent('style') 
    12 
    14 
    13 def get_the_soup(input):
    15 def get_the_soup(input):
    14     return BeautifulSoup(input, convertEntities=BeautifulSoup.ALL_ENTITIES)
    16     return BeautifulSoup(input, convertEntities=BeautifulSoup.ALL_ENTITIES)
    15      
    17