Lines Matching full:contents

90     Specifically, the contents of <script> and <style> tags should not
140 # will leave the contents of <script> and <style> tags alone. For
171 the contents of <script> and <style> tags, or not). It's
209 and self.parent is not None and self.parent.contents):
210 previous_sibling = self.parent.contents[-1]
239 "Cannot replace an element with its contents when that"
243 for child in reversed(self.contents[:]):
257 del self.parent.contents[self.parent.index(self)]
289 while isinstance(last_child, Tag) and last_child.contents:
290 last_child = last_child.contents[-1]
306 position = min(position, len(self.contents))
326 previous_child = self.contents[position - 1]
335 if position >= len(self.contents):
353 next_child = self.contents[position]
361 self.contents.insert(position, new_child)
364 """Appends the given tag to the contents of this tag."""
365 self.insert(len(self.contents), tag)
695 """A copy of a NavigableString has the same contents and class
780 """Represents a found HTML tag with its attributes and contents."""
808 self.contents = []
823 Its contents are a copy of the old Tag's contents.
829 for child in self.contents:
837 A tag that has contents is never an empty-element tag.
839 A tag that has no contents may or may not be an empty-element
846 then any tag with no contents is an empty-element tag.
848 return len(self.contents) == 0 and self.can_be_empty_element
861 if len(self.contents) != 1:
863 child = self.contents[0]
909 """Recursively destroys the contents of this tree."""
915 i.contents = []
923 for element in self.contents[:]:
929 for element in self.contents[:]:
935 tag.contents.index(element) getting the index of equal elements.
937 for i, child in enumerate(self.contents):
960 "Iterating over a tag iterates over its contents."
961 return iter(self.contents)
964 "The length of a tag is the length of its list of contents."
965 return len(self.contents)
968 return x in self.contents
971 "A tag is non-None even if it has no contents."
998 # We special case contents to avoid recursion.
999 elif not tag.startswith("__") and not tag=="contents":
1006 and the same contents (recursively) as the given tag."""
1011 not hasattr(other, 'contents') or
1016 for i, my_child in enumerate(self.contents):
1017 if my_child != other.contents[i]:
1067 """Returns a Unicode representation of this tag and its contents.
1124 contents = self.decode_contents(
1129 s = contents
1143 s.append(contents)
1144 if pretty_print and contents and contents[-1] != "\n":
1166 """Renders the contents of this tag as a Unicode string.
1208 """Renders the contents of this tag as a bytestring.
1219 contents = self.decode_contents(indent_level, encoding, formatter)
1220 return contents.encode(encoding)
1266 return iter(self.contents) # XXX This seems to be untested.
1270 if not len(self.contents):
1273 current = self.contents[0]
1523 was different from __in__ (contents). has_key() is gone in