Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider 37cae66b rédigé par Sorunome's avatar Sorunome
Parcourir les fichiers

Merge branch 'soru/escape-pipe' into develop

parents 8c51a1fd 704b3189
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -94,7 +94,7 @@ export class MatrixMessageProcessor {
msg = msg.replace(/@room/g, "@here");
}
}
const escapeChars = ["\\", "*", "_", "~", "`"];
const escapeChars = ["\\", "*", "_", "~", "`", "|"];
msg = msg.split(" ").map((s) => {
if (s.match(/^https?:\/\//)) {
return s;
......
......@@ -98,6 +98,13 @@ describe("MatrixMessageProcessor", () => {
const result = await mp.FormatMessage(msg, guild as any);
expect(result).is.equal("wow \\\\\\*this\\\\\\* is cool");
});
it("escapes ALL the stuff", async () => {
const mp = new MatrixMessageProcessor(bot);
const guild = new MockGuild("1234");
const msg = getPlainMessage("\\ * _ ~ ` |");
const result = await mp.FormatMessage(msg, guild as any);
expect(result).is.equal("\\\\ \\* \\_ \\~ \\` \\|");
});
});
describe("FormatMessage / formatted_body / simple", () => {
it("leaves blank stuff untouched", async () => {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter