Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Codidact Meta!

Codidact Meta is the meta-discussion site for the Codidact community network and the Codidact software. Whether you have bug reports or feature requests, support questions or rule discussions that touch the whole network – this is the site for you.

Some code blocks extend into the right hand panel on desktop

+4
−0

If a code block contains a line too long to fit in the available horizontal space, the excess to the right is hidden, with a scroll bar to allow seeing the rest (this is a good thing):

Raw text:

```text
This is an exceptionally long line for the purpose of demonstrating what happens when the right hand side exceeds the available horizontal space.
```

Rendered result:

This is an exceptionally long line for the purpose of demonstrating what happens when the right hand side exceeds the available horizontal space.

Summary section of a details section

However, if a code block is contained within a <details> section's <summary> section, the long line instead continues across the page to the right, obscuring the right hand panel:

Raw text:

<details>
<summary>

```text
This is an exceptionally long line for the purpose of demonstrating what happens when the right hand side exceeds the available horizontal space.
```

</summary>

```text
This is an exceptionally long line for the purpose of demonstrating what happens when the right hand side exceeds the available horizontal space.
```

</details>

Rendered result (looks fine in the editor preview):

This is an exceptionally long line for the purpose of demonstrating what happens when the right hand side exceeds the available horizontal space.
This is an exceptionally long line for the purpose of demonstrating what happens when the right hand side exceeds the available horizontal space.

If you are viewing on mobile, or a narrow desktop view (resized window or zoomed in content) the problem will not occur, so here's a screenshot:

Code block in the summary section extending into the right hand panel and beyond

Note that expanding the details section shows that the content revealed correctly has a scrollbar. Only the summary section continues across the page beyond the right hand edge of the post.

Quote block inside the summary of a details section

This problem does not show up while editing a post, so the poster has no way of knowing that it will happen until they have already saved the post. They may not notice until the next time they view their post.

There is a similar problem that does show up while editing the post:

If a code block is contained within a quote block within a <details> section's <summary> section, the long line continues across the page to the right even in the edit preview (you can see the difference between this example and the previous one by pressing "Suggest Edit" below this post):

Raw text:

<details>
<summary>

> ```text
> This is an exceptionally long line for the purpose of demonstrating what happens when the right hand side exceeds the available horizontal space.
> ```

</summary>

> ```text
> This is an exceptionally long line for the purpose of demonstrating what happens when the right hand side exceeds the available horizontal space.
> ```

</details>

Rendered result (broken even in the editor preview):

This is an exceptionally long line for the purpose of demonstrating what happens when the right hand side exceeds the available horizontal space.
This is an exceptionally long line for the purpose of demonstrating what happens when the right hand side exceeds the available horizontal space.

Note that again the content revealed correctly has a scrollbar.

Mobile and narrow desktop view

In a window narrower than 780 pixels, which covers most mobile browsers and also desktop browsers where the window has been resized or zoomed in, the problem does not occur. All of the examples above look fine, both in the editor preview and the saved post. This makes it easier for someone to create a post with this problem without realising it.

This may also hint at a solution, for anyone investigating how to fix this.

History
Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

Bug not presents in the preview during editing and on mobile. (4 comments)

1 answer

+1
−1

Code blocks are for showing source code, where lines must be shown as written. Wrapping could change the meaning. Long lines in code blocks must be shown as long lines. The best the system can do is provide a horizontal scroll bar. It looks like it is, so I don't see the problem.

History
Why does this post require moderator attention?
You might want to add some details to your flag.

2 comment threads

If I understood the original post correctly, trichoplax does not consider the use of a scroll-bar for... (6 comments)
Note this answer was before I clarified the bug report (1 comment)

Sign up to answer this question »