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

newline ignored when using emphasize-lines #204

Open
jmd-dk opened this issue Mar 21, 2023 · 1 comment
Open

newline ignored when using emphasize-lines #204

jmd-dk opened this issue Mar 21, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@jmd-dk
Copy link

jmd-dk commented Mar 21, 2023

Describe the bug

Whenever I use :emphasize-lines: within a .. code-block::, the newline in between the line(s) that is emphasized and the next disappears after copy-paste via sphinx-copybutton 0.5.1. There is no such problem with 0.5.0.

Reproduce the bug

The below simple example shows the bug:

.. code-block::
   :emphasize-lines: 1

   a = 1
   b = 2

The Sphinx generated HTML renders as

a = 1
b = 2

Copying using the copy button and then pasting should preserve this, which is indeed the usual behaviour (e.g. sphinx-copybutton 0.5.0). With sphinx-copybutton 0.5.1 however, pasting results in

a = 1b = 2

List your environment

  • sphinx-copybutton 0.5.1
  • sphinx 6.1.3
  • sphinx-rtd-theme 1.2.0
  • Python 3.11.2
  • HTML page viewed with Google Chrome 108.0.5359.98
  • Linux Mint 20
@jmd-dk jmd-dk added the bug Something isn't working label Mar 21, 2023
@jmd-dk
Copy link
Author

jmd-dk commented May 31, 2023

This is still a problem with sphinx-copybutton 0.5.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant