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

Accurately represent Matrix messages containing newlines in Slack #61

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

redgoat650
Copy link
Contributor

Newlines don't seem to be replicated correctly in slack when sent from matrix as text.

Set the PreserveWhitespace field in the format Context to preserve newlines as expected. Without this field, all "\n"s are stripped from the text during parsing, resulting in some odd-looking messages in slack.

Before:
(matrix)
newline-matrix-before
(slack)
newline-slack-before

After:
(matrix)
newline-matrix-after
(slack)
newline-slack-after

Copy link
Member

@tulir tulir left a comment

Choose a reason for hiding this comment

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

I wonder why nobody else complained 🤔

Maybe people only use newlines in messages that also include other formatting

@redgoat650
Copy link
Contributor Author

redgoat650 commented Sep 30, 2024

I wonder why nobody else complained 🤔

Yeah great question, I was wondering the same. My team happens to be doing the "ramp-up" thing right now, keeping an eye open for discrepancies like this. Perhaps other established teams either haven't upgraded (I suspect this was a regression that occurred with this refactor 2mo ago), or it didn't garner enough attention in their regular chat workflows to investigate yet 🤷

@tulir tulir merged commit aa5b58c into mautrix:main Sep 30, 2024
2 checks passed
@niebloomj
Copy link

I thought I was the only one and didn't want to seem annoying so I didn't complain haha. Thanks for fixing this!! (It think I have had this issue for the last 6 months)

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

Successfully merging this pull request may close these issues.

3 participants