Skip to content

Commit

Permalink
Merge pull request #10502 from AA-Turner/ifconfig-fix
Browse files Browse the repository at this point in the history
`ifconfig`: Add a meta node to fix iteration
  • Loading branch information
tk0miya committed Jun 2, 2022
2 parents 2a50b2e + c4458e3 commit ab58bba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sphinx/ext/ifconfig.py
Expand Up @@ -51,7 +51,7 @@ def process_ifconfig_nodes(app: Sphinx, doctree: nodes.document, docname: str) -
ns = {confval.name: confval.value for confval in app.config}
ns.update(app.config.__dict__.copy())
ns['builder'] = app.builder.name
for node in doctree.findall(ifconfig):
for node in list(doctree.findall(ifconfig)):
try:
res = eval(node['expr'], ns)
except Exception as err:
Expand Down
1 change: 1 addition & 0 deletions tests/roots/test-ext-ifconfig/conf.py
Expand Up @@ -7,3 +7,4 @@
def setup(app):
app.add_config_value('confval1', False, None)
app.add_config_value('confval2', False, None)
app.add_config_value('false_config', False, None)
10 changes: 10 additions & 0 deletions tests/roots/test-ext-ifconfig/index.rst
Expand Up @@ -9,3 +9,13 @@ ifconfig

egg

Issue 10496 regression test
===========================

.. ifconfig:: false_config

`Link 1 <https://link1.example>`__

.. ifconfig:: false_config

`Link 2 <https://link2.example>`__

0 comments on commit ab58bba

Please sign in to comment.