golang / tour

[mirror] A Tour of Go
BSD 3-Clause "New" or "Revised" License
1.53k stars 521 forks source link

tour: The output message cannot show long text completely. #48

Open OlingCat opened 8 years ago

OlingCat commented 8 years ago

On a tour page like this, if we replaced

fmt.Println("Hello, 世界")

with

fmt.Println("The output message cannot be wrapped correctly if it is too long.  [This message can not be displayed completely below.]")

the bug will be triggered.

ALTree commented 6 years ago

The underlying issue is that the "terminal-like" window below does not implement wrapping. I'm not sure how easy it would be to fix this (or if is would be worth it at all).

bgadrian commented 6 years ago

So the solution is to add Soft Wrapping to the bottom result console?

I'm asking because the terminals don't have this feature, so it would be confusing for users that are familiar with the bash terminals, but of course, it will improve the overall user experience in the tour.

When the line is too long, this happen too, if you scroll to the right (and the vertical scrollbar is invisible):

image

Another solution (easier, because it doesn't affect the height of the element), would be just to display the vertical scrollbar, when the text overflows (is too long).

Sanian-Creations commented 2 months ago

It is as easy as

.output > pre {
  overflow-x: auto;
}

or

.output > pre > span {
  text-wrap: wrap
}

Why is this not fixed yet, it's the easiest fix of your life