Skip to content

Commit

Permalink
Add self.has_equations = True to {visit,depart}_math_block()
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Oct 19, 2024
1 parent 80acc82 commit 063a64b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sphinx/writers/html5.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,26 +960,32 @@ def visit_field(self, node: Element) -> None:

def visit_math(self, node: Element, math_env: str = '') -> None:
self.has_equations = True

# see validate_math_renderer
name: str = self.builder.math_renderer_name # type: ignore[assignment]
visit, _ = self.builder.app.registry.html_inline_math_renderers[name]
visit(self, node)

def depart_math(self, node: Element, math_env: str = '') -> None:
self.has_equations = True

# see validate_math_renderer
name: str = self.builder.math_renderer_name # type: ignore[assignment]
_, depart = self.builder.app.registry.html_inline_math_renderers[name]
if depart:
depart(self, node)

def visit_math_block(self, node: Element, math_env: str = '') -> None:
self.has_equations = True

# see validate_math_renderer
name: str = self.builder.math_renderer_name # type: ignore[assignment]
visit, _ = self.builder.app.registry.html_block_math_renderers[name]
visit(self, node)

def depart_math_block(self, node: Element, math_env: str = '') -> None:
self.has_equations = True

# see validate_math_renderer
name: str = self.builder.math_renderer_name # type: ignore[assignment]
_, depart = self.builder.app.registry.html_block_math_renderers[name]
Expand Down

0 comments on commit 063a64b

Please sign in to comment.