Escape opening square bracket too

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2020-04-15 01:02:08 +01:00
parent cb10640eaf
commit 4454db30d6
4 changed files with 16 additions and 2 deletions

View file

@ -49,6 +49,12 @@ describe('editor/serialize', function() {
const html = htmlSerializeIfNeeded(model, {});
expect(html).toBe("<a href=\"https://matrix.to/#/@user:server\">Displayname\\</a>");
});
it('displaynames containing an opening square bracket work', function() {
const pc = createPartCreator();
const model = new EditorModel([pc.userPill("Displayname[", "@user:server")]);
const html = htmlSerializeIfNeeded(model, {});
expect(html).toBe("<a href=\"https://matrix.to/#/@user:server\">Displayname[</a>");
});
it('displaynames containing a closing square bracket work', function() {
const pc = createPartCreator();
const model = new EditorModel([pc.userPill("Displayname]", "@user:server")]);