Skip to content

Commit

Permalink
fix : Emojis aren't recognized after the break line in the chat messa…
Browse files Browse the repository at this point in the history
…ge - EXO-65070 (#656)

Before this change, emojis weren't recognized after a line break in the chat message. This was due to HTML character entity encoding, which encodes reserved or special characters, including the < and > characters. This change adds a regular expression to match these encoded reserved characters.
  • Loading branch information
sofyenne authored and Jihed525 committed Sep 13, 2023
1 parent 9da6465 commit 1700774
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application/src/main/webapp/vue-app/messageFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ export default function(msg, highlight, emojis) {
return msg;
}
let message = '';
const lines = msg.split(/<br\s*\/?>/);
// '&lt;' represents the '<'
// '&gt;' represents the '>'
const lines = msg.split(/<br\s*\/?>|&lt;br\s*\/?&gt;/);

lines.forEach( (line, index) => {
line = $('<div />').html(line).text();
Expand Down

0 comments on commit 1700774

Please sign in to comment.