Linkify messages with unicode drawing characters
This commit is contained in:
parent
7b11804cda
commit
0459ab02d3
2 changed files with 19 additions and 9 deletions
|
@ -62,12 +62,6 @@ describe('Link previews', () => {
|
|||
assert.isFalse(shouldLinkifyMessage('\u202e'));
|
||||
});
|
||||
|
||||
it('returns false for strings with unicode drawing characters', () => {
|
||||
assert.isFalse(shouldLinkifyMessage('\u2500'));
|
||||
assert.isFalse(shouldLinkifyMessage('\u2588'));
|
||||
assert.isFalse(shouldLinkifyMessage('\u25FF'));
|
||||
});
|
||||
|
||||
it('returns true other strings', () => {
|
||||
assert.isTrue(shouldLinkifyMessage(null));
|
||||
assert.isTrue(shouldLinkifyMessage(undefined));
|
||||
|
@ -166,6 +160,21 @@ describe('Link previews', () => {
|
|||
assert.strictEqual(isLinkSneaky(link), true);
|
||||
});
|
||||
|
||||
it('returns true for strings with unicode drawing characters', () => {
|
||||
assert.strictEqual(
|
||||
isLinkSneaky('https://example.com/\u2500/stuff'),
|
||||
true
|
||||
);
|
||||
assert.strictEqual(
|
||||
isLinkSneaky('https://example.com/\u2588/stuff'),
|
||||
true
|
||||
);
|
||||
assert.strictEqual(
|
||||
isLinkSneaky('https://example.com/\u25FF/stuff'),
|
||||
true
|
||||
);
|
||||
});
|
||||
|
||||
it('returns true for $', () => {
|
||||
const link = 'r.id$s.id';
|
||||
assert.strictEqual(isLinkSneaky(link), true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue