Bug Report | Wide code blocks can make comments flow off the screen
Describe the bug Wide code blocks in a comment cause the entire comment's thread to flow off the screen if the screen is narrower than the code (e.g. mobile). The horizontal scroll does not kick in if the code block gets too wide.
To reproduce Steps to reproduce the behavior:
- Go to https://libredd.it/r/learnpython/comments/5k6saj/how_do_i_type_a_large_block_of_code_in_reddit/
- Open up dev tools and use the responsive mode to make the viewport narrow (or you could open it on a phone)
- See the entire thread flow off the edge of the viewport. Note that comment threads without long lines of code wrap normally.
Expected behavior The code block's bounding box should get horizontal scrolling if it's too wide, just like the example below:
A really wide code block like this should have its own horizontal scrolling if it goes beyond the screen. On GitHub, you should be seeing a scrollbar at the bottom of this box if these lines are too long for the parent container.
Additional context libreddit's code block styling already supports this behaviour, but the parent containers do not shrink past the width of the longest line of code.
Applying min-width: 0; (or any small value) to .comment-right will let the comment shrink narrower than the longest line of code, which would let horizontal code scrolling work.