parent
c72139fc3f
commit
f1def8b0de
|
@ -149,7 +149,7 @@ describe('editor/deserialize', function() {
|
||||||
expect(parts[2]).toStrictEqual({type: "plain", text: "!"});
|
expect(parts[2]).toStrictEqual({type: "plain", text: "!"});
|
||||||
});
|
});
|
||||||
it('user pill with displayname containing backslash', function() {
|
it('user pill with displayname containing backslash', function() {
|
||||||
const html = "Hi <a href=\"https://matrix.to/#/@alice:hs.tld\">Alice\</a>!";
|
const html = "Hi <a href=\"https://matrix.to/#/@alice:hs.tld\">Alice\\</a>!";
|
||||||
const parts = normalize(parseEvent(htmlMessage(html), createPartCreator()));
|
const parts = normalize(parseEvent(htmlMessage(html), createPartCreator()));
|
||||||
expect(parts.length).toBe(3);
|
expect(parts.length).toBe(3);
|
||||||
expect(parts[0]).toStrictEqual({type: "plain", text: "Hi "});
|
expect(parts[0]).toStrictEqual({type: "plain", text: "Hi "});
|
||||||
|
|
|
@ -43,13 +43,13 @@ describe('editor/serialize', function() {
|
||||||
const html = htmlSerializeIfNeeded(model, {});
|
const html = htmlSerializeIfNeeded(model, {});
|
||||||
expect(html).toBe("<em>hello</em> world");
|
expect(html).toBe("<em>hello</em> world");
|
||||||
});
|
});
|
||||||
it('displaynames ending in a backslash work', function () {
|
it('displaynames ending in a backslash work', function() {
|
||||||
const pc = createPartCreator();
|
const pc = createPartCreator();
|
||||||
const model = new EditorModel([pc.userPill("Displayname\\", "@user:server")]);
|
const model = new EditorModel([pc.userPill("Displayname\\", "@user:server")]);
|
||||||
const html = htmlSerializeIfNeeded(model, {});
|
const html = htmlSerializeIfNeeded(model, {});
|
||||||
expect(html).toBe("<a href=\"https://matrix.to/#/@user:server\">Displayname\</a>");
|
expect(html).toBe("<a href=\"https://matrix.to/#/@user:server\">Displayname\\</a>");
|
||||||
});
|
});
|
||||||
it('displaynames containing a closing square bracket work', function () {
|
it('displaynames containing a closing square bracket work', function() {
|
||||||
const pc = createPartCreator();
|
const pc = createPartCreator();
|
||||||
const model = new EditorModel([pc.userPill("Displayname]", "@user:server")]);
|
const model = new EditorModel([pc.userPill("Displayname]", "@user:server")]);
|
||||||
const html = htmlSerializeIfNeeded(model, {});
|
const html = htmlSerializeIfNeeded(model, {});
|
||||||
|
|
Loading…
Reference in New Issue