Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
and node.parentNode.tagName in {
'text:placeholder',
'text:page-number',
'text:page-count',
}):
return
if node.nodeValue:
txt = node.nodeValue.strip()
if txt:
yield txt
for child in [x for x in node.childNodes]:
for string in extract(child):
yield string
zip_ = get_zip_file(BytesIO(content))
for content_xml in [
zip_.read('content.xml'),
zip_.read('styles.xml'),
]:
document = xml.dom.minidom.parseString(content_xml)
for string in extract(document.documentElement):
yield string