Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line numbers being included with code listings starting with Sphinx 4.0.0 #1168

Closed
pvcraven opened this issue Jun 19, 2021 · 2 comments
Closed
Labels
Bug A bug Needed: replication Bug replication is required
Milestone

Comments

@pvcraven
Copy link

Problem

Starting with Sphinx 4.0.0 copying a block of code with :linenos: includes the line numbers along with the code when copied.

To Reproduce
Use Sphinx 4.0.0 or later. Create an RST that references an external file, something like:

.. literalinclude:: array_backed_grid.py
    :caption: array_backed_grid.py
    :linenos:

Expected behavior
The ability to copy code without line numbers. This worked fine with Sphinx 3.5.7 and before.Example:

s2

Starting with 4.0.0 we get:

s1

Sphinx copy button extension includes line numbers as well.

According to @mgeier the theme might need to be updated to support the new Sphinx 4.0.0 setup? See comments here:
sphinx-doc/sphinx#9363

Environment info

  • OS: Windows 10
  • Python version: 3.9.5
  • Sphinx version: 4.0.0 to 4.0.2
@Blendify
Copy link
Member

This will be fixed by #1123

@agjohnson agjohnson added this to the 1.0 milestone Jul 14, 2021
@Blendify
Copy link
Member

Fixed by 380647d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug Needed: replication Bug replication is required
Projects
None yet
Development

No branches or pull requests

3 participants