Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Compatibility with sphinx 4.3 (visit_table) #509

Merged
merged 1 commit into from Nov 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion pydata_sphinx_theme/bootstrap_html_translator.py
Expand Up @@ -37,7 +37,10 @@ def visit_table(self, node):
if LooseVersion(sphinx.__version__) < LooseVersion("4.0"):
self.generate_targets_for_table(node)

self._table_row_index = 0
if LooseVersion(sphinx.__version__) < LooseVersion("4.3"):
self._table_row_index = 0
else:
self._table_row_indices.append(0)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second and subsequent elements of the list are used for the nested tables. So you should not append the value if you'd like to make a new nested table.

The last element always points to the current table. So it's better to modify its value like following:

            self._table_row_indices[-1] = 0


classes = [cls.strip(" \t\n") for cls in self.settings.table_style.split(",")]

Expand Down