Skip to content

Package description in pre tag might cause text go out of borders #33197

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

Open
andy-nix opened this issue Jan 10, 2025 · 6 comments
Open

Package description in pre tag might cause text go out of borders #33197

andy-nix opened this issue Jan 10, 2025 · 6 comments
Labels
topic/ui Change the appearance of the Gitea UI type/bug

Comments

@andy-nix
Copy link

Description

If you have markdown description with code block for (at least python) package in Gitea it might cause text go out of borders. See screenshot

Expected behaviour: description section has overflow-x: scroll style to show scroll bar if text is too long

Gitea Version

1.23.1

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

gitea-bug

Git Version

No response

Operating System

No response

How are you running Gitea?

Official release pre-built binary

Database

None

@yp05327 yp05327 added the topic/ui Change the appearance of the Gitea UI label Jan 10, 2025
@KN4CK3R
Copy link
Member

KN4CK3R commented Apr 10, 2025

@silverwind The screenshot shows overflow-y: auto added to the css class .code-block. Do you see any problems?

Image

@silverwind
Copy link
Member

silverwind commented Apr 10, 2025

I'd personally would rather have it wrap, e.g. overflow-wrap: anywhere because I strongly dislike horizontal scrollbars.

Ideally the decision to wrap such content and code in general should be a per-user setting, as I already mentioned in #34009.

@silverwind
Copy link
Member

@KN4CK3R try with tw-break-anywhere class, it's a custom class for this specific purpose:

'.break-anywhere': {

@KN4CK3R
Copy link
Member

KN4CK3R commented Apr 10, 2025

Does not work here:

Image

@wxiaoguang
Copy link
Contributor

You also need something like white-space: pre-wrap;, see MDN

@silverwind
Copy link
Member

silverwind commented Apr 10, 2025

The way this "code block" renders looks very strange (no border, no background, no copy button).

We should make this package description markup render like every other markup like in a README, then all issues will resolve themselves automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

No branches or pull requests

5 participants