diff --git a/js/models/messages.js b/js/models/messages.js index 5fddb62e0..b825a0e5d 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -458,11 +458,10 @@ const nbsp = '\xa0'; const regex = /(\S)( +)(\S+\s*)$/; return text.replace(regex, (match, start, spaces, end) => { - const newSpaces = _.reduce( - spaces, - accumulator => accumulator + nbsp, - '' - ); + const newSpaces = + end.length < 12 + ? _.reduce(spaces, accumulator => accumulator + nbsp, '') + : spaces; return `${start}${newSpaces}${end}`; }); },