Ticket #5124: contains_nontext_2.diff

File contains_nontext_2.diff, 675 bytes (added by AmanKow, 7 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(NodeList, self).__init__(*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