Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Wrap lines of code to prevent empty horizontal scroll #129

Closed
Labels
@hugovk

Description

@hugovk

Steps to reproduce

  1. On mobile, go tohttps://docs.python.org/3.13/whatsnew/3.12.html

I'm using Android / Samsung S20 / Chrome, can also repro in macOS / Chrome desktop emulating mobile with at least iPhone SE.

Expected result

Page fits in screen width, no horizontal scroll.

Actual result

You can scroll horizontally to the right and see blank bit of page:

Screenshots

This is caused by long code literals that don't wrap:

https://docs.python.org/3.13/whatsnew/3.12.html#asyncio

Screenshots

Possible fix

Addingoverflow-wrap: break-word tospan.pre and changingwhite-space: nowrap to something else (e.g.unset) can help:

Screenshots
BeforeAfter

Re:https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_text/Wrapping_breaking_text

Thiswhite-space: nowrap CSS comes fromhttps://docs.python.org/3.13/_static/basic.css which is from Sphinx:

https://github.com/sphinx-doc/sphinx/blob/d3c91f951255c6729a53e38c895ddc0af036b5b9/sphinx/themes/basic/static/basic.css_t#L762-L768

Should we fix it in Sphinx?

And we're several releases behind Sphinx and will be for a while (for example:python/cpython#104818 (comment)).

Should we instead/also put an override in this theme?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp