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

Normalize lone CRs as new lines #1099

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

josefarias
Copy link
Contributor

@josefarias josefarias commented Oct 9, 2023

One of our users ran into a scenario where copying content from Skype into a Trix editor in Chrome would record line breaks as a lone \r character. This results in the line breaks being omitted because we're not normalizing \r into a new line.

We already normalize \r\n as a \n character. This change makes it so we also normalize \r into \n.

Here's the contents of my clipboard after trying copying from Skype myself:

{
  "text/plain": "José, 02:19 PM\rTest message #1\rContent in a new line\r\rJosé, 02:19 PM\rTest message #2\rContent in another new line"
}

https://3.basecamp.com/2914079/buckets/27/card_tables/cards/6628261881

@josefarias josefarias requested a review from afcapel October 9, 2023 20:32
Copy link
Contributor

@kevinmcconnell kevinmcconnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me 👍 The new behaviour seems consistent with the other editors I tried.

@josefarias josefarias merged commit 5b179f6 into main Oct 18, 2023
@josefarias josefarias deleted the jose/account-for-lone-carriage-return-newlines branch October 18, 2023 17:26
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