foo
bar
baz
foo
bar
baz
abc
d
a c d
'), 'a [c](https://example.com/b) d'); }); it('link with different text, but not encoded', () => { assert.deepStrictEqual(fromHtml('a c d
'), 'a [c](a c d
'), 'a [c](b) d'); }); it('link without href', () => { assert.deepStrictEqual(fromHtml('a c d
'), 'a c d'); }); it('link without text', () => { assert.deepStrictEqual(fromHtml(''), 'a https://example.com/b d'); }); it('link without both', () => { assert.deepStrictEqual(fromHtml(''), 'a d'); }); it('mention', () => { assert.deepStrictEqual(fromHtml('a @user d
'), 'a @user@example.com d'); }); it('hashtag', () => { assert.deepStrictEqual(fromHtml('a #a d
', ['#a']), 'a #a d'); }); });