Skip to content

sphinx.domain.python.filter_meta_fields fails to remove more than one meta-field from a field_list #10456

@akruis

Description

@akruis

Describe the bug

If a field list contains more then one "meta"-field, the generated documentation shows all but the first meta-field.
It is a classical coding bug: the function sphinx.domain.python.filter_meta_fields stops removing meta fields after the first meta-field.

How to Reproduce

class Class:
    _public_attribute = not_to_documented
    """blah blah

    :meta public:
    :meta hide-value:
    """

Generated documentation contains a box with the text Meta hide-value:.

Expected behavior

The generated documentation does not contain any traces of the meta-fields.

Your project

Screenshots

No response

OS

Linux

Python version

3.6

Sphinx version

5.x and 4.5.x

Sphinx extensions

sphinx.ext.autodoc

Extra tools

No response

Additional context

The function filter_meta_fields was introduced by commit b968bb9, which closes #6830
I'll provide a pull request with a test and a fix.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions