--- a/mod_muc_inject_mentions/mod_muc_inject_mentions.lua Sun Sep 20 15:04:22 2020 +0200
+++ b/mod_muc_inject_mentions/mod_muc_inject_mentions.lua Sun Sep 20 15:24:09 2020 +0200
@@ -119,9 +119,9 @@
if first == 1 and last == #body then
table.insert(mentions, {bare_jid=bare_jid, first=first, last=last})
- -- Nickname between spaces
- elseif body:sub(first - 1, first - 1) == " " and
- body:sub(last + 1, last + 1) == " "
+ -- Nickname between spaces or new lines
+ elseif body:sub(first - 1, first - 1) == " " or body:sub(first - 1, first - 1) == "\n" and
+ body:sub(last + 1, last + 1) == " " or body:sub(last + 1, last + 1) == "\n"
then
table.insert(mentions, {bare_jid=bare_jid, first=first, last=last})
else