This commit is contained in:
syuilo 2017-03-18 01:16:32 +09:00
parent 5ad77e8a3a
commit bc3006f3c4
9 changed files with 92 additions and 17 deletions

View file

@ -49,11 +49,23 @@ describe('Text', () => {
], tokens);
});
it('link', () => {
it('url', () => {
const tokens = analyze('https://himasaku.net');
assert.deepEqual([
{ type: 'link', content: 'https://himasaku.net' }
], tokens);
assert.deepEqual([{
type: 'url',
content: 'https://himasaku.net',
url: 'https://himasaku.net'
}], tokens);
});
it('link', () => {
const tokens = analyze('[ひまさく](https://himasaku.net)');
assert.deepEqual([{
type: 'link',
content: '[ひまさく](https://himasaku.net)',
title: 'ひまさく',
url: 'https://himasaku.net'
}], tokens);
});
it('emoji', () => {