fix: trimmed mentioned user text in messages when special characters used #1909
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎯 Goal
When users with special characters such as
-
or_
are mentioned in the message and sent. The mentioned user is trimmed in the message bubble. This can be tested by mentioning users likedivine-flower-3
,dummy_tummy
etc., in our channel -Determined Detail
(Channel Cid -channel-ex-example-apps-23
) in our TypescriptMessagingApp.Ref Zendesk Ticket - https://getstream.zendesk.com/agent/tickets/33250
🛠 Implementation details
The node of such a user as parsed by
simple-markdown
is:dummy_tummy
divine-flower-3
Previously only the
node.content[0].content
was rendered, which is why the text was trimmed; now, the entire name is joined/concatenated using thereduce
function and displayed. Therefore it works.🎨 UI Changes
Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-01-13.at.11.52.19.mp4
Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-01-13.at.11.53.46.mp4
🧪 Testing
☑️ Checklist
develop
branch