Skip to content

:number-lines: 0 for includes does not work correctly with docutils 0.22 #14261

Description

@chrisjsewell

Describe the bug

Because of this change: live-clones/docutils@f39ac14

.. include:: ...
   :code: python
   :number-lines: 0

.. include:: ...
   :literal:
   :number-lines: 0

Now numbering starts at 1 rather than 0

This is because the value parsed from the directive option has now changed from a None|str to None|int,
previously int("0" or 1) turned into 0, but now 0 or 1 turns into 1

How to Reproduce

...

Environment Information

...

Sphinx extensions

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions