End value is index+1 as per the newest revision https://xmpp.org/extensions/xep-0372.html#revision-history-v0.4.0
--- a/mod_muc_inject_mentions/mod_muc_inject_mentions.lua Mon Dec 21 19:29:04 2020 +0100
+++ b/mod_muc_inject_mentions/mod_muc_inject_mentions.lua Tue Dec 22 11:18:46 2020 +0100
@@ -251,7 +251,7 @@
"reference", {
xmlns=reference_xmlns,
begin=tostring(mention.first - 1), -- count starts at 0
- ["end"]=tostring(mention.last - 1),
+ ["end"]=tostring(mention.last),
type="mention",
uri="xmpp:" .. mention.bare_jid,
}