From e1dccb8562d20cb48e5d17f4f38ab2a687af1da7 Mon Sep 17 00:00:00 2001 From: Hubert Hirtz Date: Thu, 18 Jun 2020 17:55:47 +0200 Subject: [PATCH] irc: Strip lone backslashes from tag values According to the message-tags spec: > If a lone \ exists at the end of an escaped value (with no escape > character following it), then there SHOULD be no output character. For > example, the escaped value test\ should unescape to test. https://ircv3.net/specs/extensions/message-tags --- assets/irc.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/assets/irc.js b/assets/irc.js index 37bb4cb..6766a1b 100644 --- a/assets/irc.js +++ b/assets/irc.js @@ -36,6 +36,9 @@ function parseTags(s) { for (var ch in tagsEscape) { v = v.replaceAll(tagsEscape[ch], ch); } + if (v.endsWith("\\")) { + v = v.slice(0, v.length - 1) + } tags[k] = v; }); return tags;