-
Notifications
You must be signed in to change notification settings - Fork 333
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
Copy button double-spaces highlighted lines in documented code samples #1489
Comments
If you type in 'pip freeze' can you confirm you have 'pyglet==2.0.dev23'? Running 2.6.17 I'm not able to reproduce. Line 155 is a comment too, make sure the code wasn't accidentally modified. |
Yes, that's correct.
When I press
I don't see such issue on other examples. Probably something wrong with the code formatting on that specific case. |
Proably gets mangled in the copy. Safer expression is self.tank.position = (
self.tank.center_x + x_dir,
self.tank.center_y + y_dir,
) |
Could we update the example on dev branch with the following?
The end result would be more resistant to copy and paste problems and should still be compatible with setting |
yes, I've updated issue description accordingly |
@pvcraven @einarf tl;dr using a plugin-created copy button instead of copying a direct selection results in duplicated newlines on all lines which were highlighted inside the code block I'm running Chromium under Debian, and have verified it on the following pages for 2.5.7, 2.6.0, and latest (2.6.17) on
I suspect it affects all versions, but I can't verify the dev branch because its CSS appears to be broken at the moment: Steps to replicate for doc versions hosted on
|
This seems to be a broken interaction between these two sphinx plugins: Lines 53 to 54 in 102c27f
The doc for |
@alderven Could you please verify the following temporary workarounds? Only the highlighted section
The entire code block
|
tl;dr:
The plugin's exclusion selector argument might not work here. To my understanding, parent selectors will exclude the highlighted line the same way excluding Parsing the DOM in JS could work, but it's ugly and seems wasteful even if we cache the result. |
If any of this is still relevant it will be fixed in #2243 |
Steps to reproduce:
Copy code from following example: Sprite Rotation Around a Tank
Extra lines added to copied text. E.g.
should be:
The text was updated successfully, but these errors were encountered: