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
This commit is contained in:
@@ -36,6 +36,9 @@ function parseTags(s) {
|
|||||||
for (var ch in tagsEscape) {
|
for (var ch in tagsEscape) {
|
||||||
v = v.replaceAll(tagsEscape[ch], ch);
|
v = v.replaceAll(tagsEscape[ch], ch);
|
||||||
}
|
}
|
||||||
|
if (v.endsWith("\\")) {
|
||||||
|
v = v.slice(0, v.length - 1)
|
||||||
|
}
|
||||||
tags[k] = v;
|
tags[k] = v;
|
||||||
});
|
});
|
||||||
return tags;
|
return tags;
|
||||||
|
|||||||
Reference in New Issue
Block a user