Skip to content
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

show a checkbox to word wrap text #137

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

JyotsnaGorle
Copy link

Demo

fluffy_wrd_wrap.mov

Description + Issues

  • The application generates rendered html pages as result. In order to do a word wrap after pasting and submitting the text would cause performance issues in runtime as well as storage.
  • It would require to re run the entire /paste endpoint - generating duplicate htmls + re-rendering the same.
  • Hence

Screenshot 2022-05-11 at 13 24 32

this checkbox before submitting the item.

Please let me know if you have an idea how to do it in the editor itself. for example here.
Screenshot 2022-05-11 at 13 23 11

@JyotsnaGorle JyotsnaGorle marked this pull request as draft May 11, 2022 11:25
@JyotsnaGorle JyotsnaGorle marked this pull request as ready for review May 11, 2022 11:45
@chriskuehl
Copy link
Owner

Thanks for the PR! This is definitely something I've wanted for a long time but haven't been quite sure how to implement.

I'm a little worried about whether this is doing what most people think of when they request "word wrap" as a feature. Based on the previous request in #40 and related ones I've seen, my understanding is that the main request is to wrap lines so that there isn't a horizontal scrollbar by automatically flowing to the next line, without inserting a hard line break to the text itself. Here's an example of how pastebin.com does it: https://pastebin.com/rEXmfMsU

With the way this is implemented, I'm concerned it doesn't really work for most use cases. The main feature for text uploads is to upload code, but checking this box will cause code to be wrapped without language context and likely break almost all code, which defeats the purpose of sharing it with others in a pastebin.

Ideally I would like to find a pure-CSS solution if possible (maybe with a little JavaScript if needed to fix the line numbers or something) that can be applied by a checkbox on the paste view, in the same way that users can switch between different themes without creating a new paste. I think this is a nice UX fit since this is more of a display option and different people will prefer different ways of viewing the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants