1
0
mirror of https://github.com/django/django.git synced 2025-01-03 06:55:47 +00:00

Removed unnecessary workarounds for Sphinx < 4.3.0.

Unnecessary since ebf25555bb.
This commit is contained in:
Sarah Boyce 2023-05-04 13:55:06 +02:00 committed by GitHub
parent fcfbf08abe
commit 60ac77f32e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,6 @@ from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.statemachine import ViewList
from sphinx import addnodes
from sphinx import version_info as sphinx_version
from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.directives.code import CodeBlock
from sphinx.domains.std import Cmdoption
@ -118,15 +117,11 @@ class DjangoHTMLTranslator(HTMLTranslator):
self.context.append(self.compact_p)
self.compact_p = True
# Needed by Sphinx.
if sphinx_version >= (4, 3):
self._table_row_indices.append(0)
else:
self._table_row_index = 0
self.body.append(self.starttag(node, "table", CLASS="docutils"))
def depart_table(self, node):
self.compact_p = self.context.pop()
if sphinx_version >= (4, 3):
self._table_row_indices.pop()
self.body.append("</table>\n")