PY-18740 Fix TypeError in rest_formatter.py when directive returned by _strip_markup is None

This commit is contained in:
Mikhail Golubev
2016-03-10 12:39:49 +03:00
parent 7ba4efa774
commit 54782ab8bb
+1 -1
View File
@@ -224,7 +224,7 @@ class RestHTMLTranslator(HTMLTranslator):
return HTMLTranslator.visit_problematic(self, node)
directive, text = self._strip_markup(node.astext())
if directive[1:-1] in ('exc', 'class'):
if directive and directive[1:-1] in ('exc', 'class'):
self.body.append(self.starttag(node, 'a', '', href='psi_element://#typename#' + text))
self.body.append(text)
self.body.append('</a>')