mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix autosectionlabel_maxdepth is 0 origin
This commit is contained in:
parent
9f3feb6315
commit
2d44232e34
@ -45,7 +45,7 @@ def register_sections_as_label(app, document):
|
|||||||
anonlabels = app.env.domaindata['std']['anonlabels']
|
anonlabels = app.env.domaindata['std']['anonlabels']
|
||||||
for node in document.traverse(nodes.section):
|
for node in document.traverse(nodes.section):
|
||||||
if (app.config.autosectionlabel_maxdepth and
|
if (app.config.autosectionlabel_maxdepth and
|
||||||
get_node_depth(node) > app.config.autosectionlabel_maxdepth):
|
get_node_depth(node) >= app.config.autosectionlabel_maxdepth):
|
||||||
continue
|
continue
|
||||||
labelid = node['ids'][0]
|
labelid = node['ids'][0]
|
||||||
docname = app.env.docname
|
docname = app.env.docname
|
||||||
|
@ -71,7 +71,7 @@ def test_autosectionlabel_prefix_document_html(app, status, warning):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.sphinx('html', testroot='ext-autosectionlabel',
|
@pytest.mark.sphinx('html', testroot='ext-autosectionlabel',
|
||||||
confoverrides={'autosectionlabel_maxdepth': 2})
|
confoverrides={'autosectionlabel_maxdepth': 3})
|
||||||
def test_autosectionlabel_maxdepth(app, status, warning):
|
def test_autosectionlabel_maxdepth(app, status, warning):
|
||||||
return test_autosectionlabel_html(app, status, warning,
|
return test_autosectionlabel_html(app, status, warning,
|
||||||
skipped_labels=True)
|
skipped_labels=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user