diff --git a/client/src/Chat.js b/client/src/Chat.js index 14b61c5..de309a5 100644 --- a/client/src/Chat.js +++ b/client/src/Chat.js @@ -81,19 +81,25 @@ const Chat = ({ table }) => { } const messages = table.game && table.game.chat.map((item, index) => { + const punctuation = item.message.match(/(\.+$)/); + let period; + if (punctuation) { + period = punctuation[1]; + } else { + period = ''; + } let lines = item.message.split('.'); - const message = lines.map((line, index) => { - if (line.trim() === '') { - return <>>; - } + const message = lines + .filter(line => line.trim() !== '') + .map((line, index) => { /* If the date is in the future, set it to now */ const dice = line.match(/^(.*rolled )([1-6])(, ([1-6]))?(.*)$/); if (dice) { if (dice[4]) { return