Firefox 10.0.11 was having trouble with:
<span style="..." />
Which, instead of being a no-op, was changing the default styling of
every element after that tag.
i += 1
return chunks
+ def _drop_empty_text(self, chunks):
+ i = 0
+ while i < len(chunks):
+ if isinstance(chunks[i], str) and not chunks[i]:
+ chunks.pop(i)
+ else:
+ i += 1
+ return chunks
+
def _remove_operating_system_commands(self, chunks):
i = 0
while i < len(chunks):
chunks = self._drop_clear_line(chunks)
chunks = self._collapse_adjacent_newlines(chunks)
chunks = self._merge_adjacent_text(chunks)
+ chunks = self._drop_empty_text(chunks)
chunks = self._style_chunks(chunks)
previous = element
last_chunk = None