Ticket #5124: contains_nontext.diff

File contains_nontext.diff, 665 bytes (added by Wayne K. Werner, 17 years ago)
  • __init__.py

     
    737737        return nodes
    738738
    739739class NodeList(list):
    740     # Set to True the first time a non-TextNode is inserted by
    741     # extend_nodelist().
    742     contains_nontext = False
     740    def __init__(self, *args, **kwargs):
     741        # call the list constructor
     742        super.__init__(self, *args, **kwargs)
     743        # Set to True by Parser.extend_nodelist()
     744        # the first time it inserts a non-TextNode.
     745        self.contains_nontext = False
    743746
    744747    def render(self, context):
    745748        bits = []
Back to Top