diff --git a/sphinx_tabs/tabs.py b/sphinx_tabs/tabs.py index aa04138..c4000e5 100644 --- a/sphinx_tabs/tabs.py +++ b/sphinx_tabs/tabs.py @@ -66,7 +66,7 @@ def visit(translator, node): attrs.pop("ids") attrs.pop("names") attrs.pop("dupnames") - attrs.pop("backrefs") + attrs.pop("backrefs", None) text = translator.starttag(node, node.tagname, **attrs) translator.body.append(text.strip()) diff --git a/tests/conftest.py b/tests/conftest.py index 1dbf0ad..94075e2 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,6 +2,7 @@ import pytest from pathlib import Path from bs4 import BeautifulSoup +import docutils import sphinx from sphinx_tabs.tabs import JS_FILES, CSS_FILES @@ -128,6 +129,9 @@ def read(app, docname="index", resolve=False, regress=False, replace=None): '', "", ) + if docutils.__version_info__ < (0, 22): + text = text.replace('="False"', '="0"') + text = text.replace('linenos="True"', 'linenos="1"') file_regression.check(text, extension=extension) return doctree diff --git a/tests/test_build/test_conditional_assets_html_assets_policy_index_.xml b/tests/test_build/test_conditional_assets_html_assets_policy_index_.xml index 20c4dc9..ff35e60 100644 --- a/tests/test_build/test_conditional_assets_html_assets_policy_index_.xml +++ b/tests/test_build/test_conditional_assets_html_assets_policy_index_.xml @@ -1,6 +1,6 @@ -