-
Notifications
You must be signed in to change notification settings - Fork 69
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
Code blocks (I think?) don't word wrap #1556
Comments
Hey @machinaeZER0, thanks for the question! I won't say that we would never implement an option for wrapping code blocks, but I will say that it's very intentional that they don't wrap. When you're dealing with code, line breaks often have specific meaning, and you don't want any additional ones to be introduced automatically by the tool you're using to view the code. That's exactly why there's a separate option in markdown for code formatting: so that it doesn't get altered in any unintentional way. You'll notice that the Lemmy web UI renders the code blocks in exactly the same way. Even though my monitor is obviously much wider than my phone, I still have to scroll horizontally to view all of the text. In my opinion, the real problem is that the poster used a code block at all, since they weren't referencing code. They should have used a quote block, which is perfect for quoting text, as they were doing, and it would wrap the text. I hope that makes sense, and I hope it doesn't come across as putting down your request at all. I just wanted to provide some clarification for why things work the way they do. |
Thank you, I had a feeling this might be the case! Do you think it would be more trouble than it's worth to have a "word wrap code blocks" option in settings? I could see it being a handy option for laypeople who aren't coders/a good catch all option since people will misuse code blocks in this way from time to time. Obviously the people posting should be using the right block for the right tool, so I can totally see why we wouldn't want to "waste" dev hours on supporting unintended behavior, so mostly just thinking out loud :) either way, appreciate your reply/explanation (as always)! |
Ohh, that is useful! I'll keep that in mind for the future :) thanks Micah! |
Apologies if these are a different element than a code block! I've noticed for some time that the type of text shown below displays as a single line on mobile unless line breaks are manually entered - scrollable, but not super ideal presentation wise.
(Post in question can be viewed here: https://lemmy.zip/post/22426238)
Is it possible to tweak this behavior, or is it technically a feature of that particular formatting?
The text was updated successfully, but these errors were encountered: