Better emoji support in linkify/previews
This commit is contained in:
parent
65ad608aa7
commit
773aa9af19
15 changed files with 337 additions and 260 deletions
|
@ -7,7 +7,7 @@ const {
|
|||
findLinks,
|
||||
isLinkSafeToPreview,
|
||||
isLinkSneaky,
|
||||
} = require('../../js/modules/link_previews');
|
||||
} = require('../../ts/types/LinkPreview');
|
||||
|
||||
describe('Link previews', () => {
|
||||
describe('#isLinkSafeToPreview', () => {
|
||||
|
@ -54,6 +54,15 @@ describe('Link previews', () => {
|
|||
assert.deepEqual(expected, actual);
|
||||
});
|
||||
|
||||
it('returns all links after emojis without spaces in between', () => {
|
||||
const text = '😎https://github.com/signalapp/Signal-Desktop😛';
|
||||
|
||||
const expected = ['https://github.com/signalapp/Signal-Desktop'];
|
||||
|
||||
const actual = findLinks(text);
|
||||
assert.deepEqual(expected, actual);
|
||||
});
|
||||
|
||||
it('includes all links if cursor is not in a link', () => {
|
||||
const text =
|
||||
'Check out this link: https://github.com/signalapp/Signal-Desktop\nAnd this one too: https://github.com/signalapp/Signal-Android';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue