mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
fix #10456: fix sphinx.domain.python.filter_meta_fields()
The function now removes all "meta"-fields from a field-list.
This commit is contained in:
parent
6ffe881f55
commit
d1ba8d598d
@ -1068,11 +1068,11 @@ def filter_meta_fields(app: Sphinx, domain: str, objtype: str, content: Element)
|
||||
for node in content:
|
||||
if isinstance(node, nodes.field_list):
|
||||
fields = cast(List[nodes.field], node)
|
||||
for field in fields:
|
||||
# removing list items while iterating the list needs reversed()
|
||||
for field in reversed(fields):
|
||||
field_name = cast(nodes.field_body, field[0]).astext().strip()
|
||||
if field_name == 'meta' or field_name.startswith('meta '):
|
||||
node.remove(field)
|
||||
break
|
||||
|
||||
|
||||
class PythonModuleIndex(Index):
|
||||
|
Loading…
Reference in New Issue
Block a user