mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-14 19:25:26 -05:00
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:
parent
a1582dcc62
commit
e1dccb8562
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue