1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-05-02 11:50:52 +02:00

Removing couple of "buildins" polyglot types

This commit is contained in:
2020-04-20 20:22:50 +02:00
parent eac0b98d6f
commit c867f0321b
36 changed files with 85 additions and 109 deletions
+2 -3
View File
@@ -4,7 +4,6 @@ Transform OEB content into plain text
import re
from lxml import etree
from ebook_converter.polyglot.builtins import string_or_bytes
__license__ = 'GPL 3'
@@ -189,10 +188,10 @@ class TXTMLizer(object):
'''
from ebook_converter.ebooks.oeb.base import XHTML_NS, barename, namespace
if not isinstance(elem.tag, string_or_bytes) \
if not isinstance(elem.tag, (str, bytes)) \
or namespace(elem.tag) != XHTML_NS:
p = elem.getparent()
if p is not None and isinstance(p.tag, string_or_bytes) and namespace(p.tag) == XHTML_NS \
if p is not None and isinstance(p.tag, (str, bytes)) and namespace(p.tag) == XHTML_NS \
and elem.tail:
return [elem.tail]
return ['']