diff -Nur epydoc/markup/restructuredtext.py epydoc/markup/restructuredtext.py --- epydoc/markup/restructuredtext.py +++ epydoc/markup/restructuredtext.py @@ -304,10 +304,11 @@ # Extract the first sentence. for child in node: if isinstance(child, docutils.nodes.Text): - m = self._SUMMARY_RE.match(child.data) + data = child.astext() + m = self._SUMMARY_RE.match(data) if m: summary_pieces.append(docutils.nodes.Text(m.group(1))) - other = child.data[m.end():] + other = data[m.end():] if other and not other.isspace(): self.other_docs = True break @@ -488,11 +489,11 @@ # Remove the separating ":", if present if (len(fbody[0]) > 0 and isinstance(fbody[0][0], docutils.nodes.Text)): - child = fbody[0][0] - if child.data[:1] in ':-': - child.data = child.data[1:].lstrip() - elif child.data[:2] in (' -', ' :'): - child.data = child.data[2:].lstrip() + content = fbody[0][0].astext() + if content[:1] in ':-': + fbody[0][0] = docutils.nodes.Text(content[1:].lstrip()) + elif content[:2] in (' -', ' :'): + fbody[0][0] = docutils.nodes.Text(content[2:].lstrip()) # Wrap the field body, and add a new field self._add_field(tagname, arg, fbody)