requests icon indicating copy to clipboard operation
requests copied to clipboard

docs(socks): same block as other sections

Open magsen opened this issue 1 year ago • 6 comments

strange formatting: https://docs.python-requests.org/en/latest/user/advanced/#socks

magsen avatar Oct 18 '23 13:10 magsen

The current formatting looks correct to me. What looks wrong to you?

sigmavirus24 avatar Oct 18 '23 13:10 sigmavirus24

i have some kind of strange underscore

image

In a private firefox without dark theme image image


https://github.com/psf/requests/blob/main/docs/user/advanced.rst

In the rst preview you can see that this bash code block is not the same as the other bash code bloc

magsen avatar Oct 18 '23 16:10 magsen

I cannot replicate that on Firefox on macOS or Linux

sigmavirus24 avatar Oct 18 '23 16:10 sigmavirus24

I cannot replicate that on Firefox on macOS or Linux.

I would be willing to entertain a PR, however that adds sphinx-prompt to our docs dependencies and switches this to using .. prompt:: instead because that's more correct

sigmavirus24 avatar Oct 18 '23 18:10 sigmavirus24

I am actually able to replicate this on macOS in Firefox 115.3.1esr (64-bit). It appears whitespace in these blocks are being replaced with span tags with the w CSS class from pygments. This adds a faint white (#f8f8f8) underline to each whitespace.

Screenshot 2023-10-18 at 12 26 22 PM

I don't however immediately see why this is being added specifically for the bash codeblock. I'm fine moving to the simplified syntax (::) (or .. prompt:: as Ian noted) in this case since the bash formatting doesn't materially change the output, but it would be interesting to understand why it's happening.

nateprewitt avatar Oct 18 '23 18:10 nateprewitt

To find out why it's happening I suspect we'll need a pygments bug to investigate.

The span doesn't change what you copy out of the text though

sigmavirus24 avatar Oct 18 '23 19:10 sigmavirus24