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

Preserve paragraphs in comments #129

Merged
merged 4 commits into from
Sep 25, 2024
Merged

Conversation

tom-sherman
Copy link
Contributor

@tom-sherman tom-sherman commented Sep 25, 2024

We're saving comments with newlines in the db but just discarding them by rendering the comment to a single text node.

This is mostly just a quick stop-gap fix until we get proper rich text editing.

https://frontpage-git-preserve-paragraphs-in-comments-likeandscribe.vercel.app/post/tom-sherman.com/3kuuvmpeytj2q/tom-sherman.com/3l4xqnajkkk2p

https://frontpage-git-preserve-paragraphs-in-comments-likeandscribe.vercel.app/post/purlane.ink/3l4xe52w6zw2n/purlane.ink/3l4xfw6a7z32z

Copy link

vercel bot commented Sep 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frontpage ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2024 3:19pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
atproto-browser ⬜️ Ignored (Inspect) Visit Preview Sep 25, 2024 3:19pm
unravel ⬜️ Ignored (Inspect) Visit Preview Sep 25, 2024 3:19pm

@tom-sherman
Copy link
Contributor Author

This needs more thought...

image

@tom-sherman tom-sherman marked this pull request as draft September 25, 2024 08:46
@tom-sherman
Copy link
Contributor Author

So i think we should:

  • collapse duplicate newlines on the client when you submit eg. \n\n\n\n\n -> \n\n
  • use whitespace: pre-wrap to render them
  • implement a collapse/expand mechanism for long comments (we need this anyway for real long comments)

@tom-sherman
Copy link
Contributor Author

Decided not to do truncation, at least for now. Reddit doesn't truncate and I think truncating would encourage shorter form comments which isn't something we probably want to encourage.

@tom-sherman tom-sherman marked this pull request as ready for review September 25, 2024 16:11
@tom-sherman tom-sherman merged commit 743bcac into main Sep 25, 2024
7 checks passed
@tom-sherman tom-sherman deleted the preserve-paragraphs-in-comments branch September 25, 2024 17:06
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.

2 participants