mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix possible 'no-wrap' KeyError in maths nodes (#13323)
This commit is contained in:
parent
790bee64ce
commit
b59d1b7513
@ -365,7 +365,7 @@ def html_visit_math(self: HTML5Translator, node: nodes.math) -> None:
|
||||
|
||||
|
||||
def html_visit_displaymath(self: HTML5Translator, node: nodes.math_block) -> None:
|
||||
if node['no-wrap'] or node['nowrap']:
|
||||
if node.get('no-wrap', node.get('nowrap', False)):
|
||||
latex = node.astext()
|
||||
else:
|
||||
latex = wrap_displaymath(node.astext(), None, False)
|
||||
|
@ -47,7 +47,7 @@ def html_visit_math(self: HTML5Translator, node: nodes.math) -> None:
|
||||
|
||||
def html_visit_displaymath(self: HTML5Translator, node: nodes.math_block) -> None:
|
||||
self.body.append(self.starttag(node, 'div', CLASS='math notranslate nohighlight'))
|
||||
if node['no-wrap']:
|
||||
if node.get('no-wrap', node.get('nowrap', False)):
|
||||
self.body.append(self.encode(node.astext()))
|
||||
self.body.append('</div>')
|
||||
raise nodes.SkipNode
|
||||
|
@ -2465,7 +2465,7 @@ class LaTeXTranslator(SphinxTranslator):
|
||||
else:
|
||||
label = None
|
||||
|
||||
if node.get('no-wrap'):
|
||||
if node.get('no-wrap', node.get('nowrap', False)):
|
||||
if label:
|
||||
self.body.append(r'\label{%s}' % label)
|
||||
self.body.append(node.astext())
|
||||
|
Loading…
Reference in New Issue
Block a user