mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Another try to fix docutils version differences.
This commit is contained in:
parent
51760a0fde
commit
b4ef4da181
@ -160,7 +160,12 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
||||
"""Remove all HTML markup and return only the text nodes."""
|
||||
for c in doctree.children:
|
||||
if isinstance(c, nodes.Text):
|
||||
result.append(c)
|
||||
try:
|
||||
# docutils 0.4 and 0.5: Text is a UserString subclass
|
||||
result.append(c.data)
|
||||
except AttributeError:
|
||||
# docutils 0.6: Text is a unicode subclass
|
||||
result.append(c)
|
||||
else:
|
||||
result = self.collapse_text(c, result)
|
||||
return result
|
||||
|
Loading…
Reference in New Issue
Block a user