[FIX] Updating a message causing URLs to be parsed even within markdown code#21489
Merged
sampaiodiego merged 2 commits intodevelopfrom Apr 15, 2021
Merged
[FIX] Updating a message causing URLs to be parsed even within markdown code#21489sampaiodiego merged 2 commits intodevelopfrom
sampaiodiego merged 2 commits intodevelopfrom
Conversation
sampaiodiego
requested changes
Apr 8, 2021
Member
sampaiodiego
left a comment
There was a problem hiding this comment.
Can you also pls add at least some e2e tests? =)
|
|
||
| const urls = message.msg.match(/([A-Za-z]{3,9}):\/\/([-;:&=\+\$,\w]+@{1})?([-A-Za-z0-9\.]+)+:?(\d+)?((\/[-\+=!:~%\/\.@\,\w]*)?\??([-\+=&!:;%@\/\.\,\w]+)?(?:#([^\s\)]+))?)?/g) || []; | ||
| message.urls = urls.map((url) => ({ url })); | ||
| if (message.parseUrls !== false) { |
Member
There was a problem hiding this comment.
I think it would make sense to move this code to a common function and use on sendMessage and here at updateMessage instead of having this code duplicated, wdyt?
sampaiodiego
approved these changes
Apr 15, 2021
gabriellsh
added a commit
that referenced
this pull request
Apr 15, 2021
…user_info * 'develop' of github.com:RocketChat/Rocket.Chat: (40 commits) [FIX] Typos/missing elements in the French translation (#21525) [FIX] Archive permissions for room moderator (#21563) [FIX] Checking 'start-discussion' Permission for MessageBox Actions (#21564) [FIX] Correcting the case there are no result in admin users list (#21556) [FIX] Don't allow whitespace on bold, italic and strike (#21483) [FIX] Message Block ordering (#21464) [IMPROVE] Add proxy for data export (#20998) [FIX] Updating a message causing URLs to be parsed even within markdown code (#21489) Bump version to 3.13.2 [FIX] Fix the bugs opening discussions (#21557) A React-based replacement for BlazeLayout (#21527) Language update from LingoHub 🤖 on 2021-04-12Z (#21530) Chore: Increase testing coverage on password policy class (#21482) Chore: Meteor update to 2.1.1 (#21494) Chore: Do not stop animations on Test Mode (#21484) Chore: Remove control character from room model operation (#21493) [NEW] New set of rules for client code (#21318) Bump version to 3.13.1 [FIX] Header component breaking if user is not part of teams room (#21465) [FIX] Admin Users list pagination (#21469) ...
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Proposed changes (including videos or screenshots)
updateMessageto avoid parsing URLs inside markdownparseUrlsproperty when updating messagesIssue(s)
Steps to test or reproduce
Further comments