Skip to content

Commit

Permalink
Merge pull request #9884 from c0dzilla/parse
Browse files Browse the repository at this point in the history
[FIX] Parsing messages with multiple markdown matches ignore some tokens
  • Loading branch information
rodrigok committed Feb 26, 2018
2 parents 4cdb12d + 11e0601 commit 5033cab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/rocketchat-ui-message/client/renderMessageBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ renderMessageBody = function(msg) {
const message = RocketChat.callbacks.run('renderMessage', msg);

if (message.tokens && message.tokens.length > 0) {
for (const {token, text} of message.tokens) {
// Unmounting tokens(LIFO)
for (const {token, text} of message.tokens.reverse()) {
message.html = message.html.replace(token, () => text); // Uses lambda so doesn't need to escape $
}
}
Expand Down

0 comments on commit 5033cab

Please sign in to comment.