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,6 +160,11 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
|||||||
"""Remove all HTML markup and return only the text nodes."""
|
"""Remove all HTML markup and return only the text nodes."""
|
||||||
for c in doctree.children:
|
for c in doctree.children:
|
||||||
if isinstance(c, nodes.Text):
|
if isinstance(c, nodes.Text):
|
||||||
|
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)
|
result.append(c)
|
||||||
else:
|
else:
|
||||||
result = self.collapse_text(c, result)
|
result = self.collapse_text(c, result)
|
||||||
|
Loading…
Reference in New Issue
Block a user