ignore unrecognized inline directives

When we see a directive we do not understand, skip it instead of
reporting an error. This avoids embedding system error messages in the
output at the expense of sometimes leaking rst directives.

See the murano-dashboard 3.0.0 release announcement for an example of
the error this
addresses. http://lists.openstack.org/pipermail/openstack-announce/2016-October/001748.html

Change-Id: I28dd334b7d326e13e7aaf7cd9c0a160ae1e9fa09
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2016-10-06 12:58:47 -04:00
parent 58c61a7fcb
commit 9c713109f3

View File

@ -937,15 +937,12 @@ class TextTranslator(nodes.NodeVisitor):
pass
def visit_problematic(self, node):
self.add_text('>>')
pass
def depart_problematic(self, node):
self.add_text('<<')
pass
def visit_system_message(self, node):
self.new_state(0)
self.add_text('<SYSTEM MESSAGE: %s>' % node.astext())
self.end_state()
raise nodes.SkipNode
def visit_comment(self, node):