From 4ecd036d0ad59bb17925b1491b2ed67b20014d65 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Sat, 6 Feb 2021 21:44:46 +0900 Subject: Fix HTML to MFM (#7150) * Fix type * Fix HTML to MFM --- test/mfm.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/mfm.ts b/test/mfm.ts index a32457e89f..0a120f96e1 100644 --- a/test/mfm.ts +++ b/test/mfm.ts @@ -1167,6 +1167,10 @@ describe('fromHtml', () => { assert.deepStrictEqual(fromHtml('

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]() d'); + }); + it('link with same text', () => { assert.deepStrictEqual(fromHtml('

a https://example.com/b d

'), 'a https://example.com/b d'); }); @@ -1183,6 +1187,14 @@ describe('fromHtml', () => { assert.deepStrictEqual(fromHtml('

a c d

'), 'a c d'); }); + it('link without text', () => { + assert.deepStrictEqual(fromHtml('

a d

'), 'a https://example.com/b d'); + }); + + it('link without both', () => { + assert.deepStrictEqual(fromHtml('

a d

'), 'a d'); + }); + it('mention', () => { assert.deepStrictEqual(fromHtml('

a @user d

'), 'a @user@example.com d'); }); -- cgit v1.2.3-freya