diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2021-09-26 01:57:38 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-26 01:57:38 +0900 |
| commit | ece3ac967d90cb2e9744a2ebd55dcbee90cdb980 (patch) | |
| tree | a2e67f35251d27417345f898a311595c9330c489 /test | |
| parent | fix(client): fix tabs of page header behaviour (diff) | |
| download | sharkey-ece3ac967d90cb2e9744a2ebd55dcbee90cdb980.tar.gz sharkey-ece3ac967d90cb2e9744a2ebd55dcbee90cdb980.tar.bz2 sharkey-ece3ac967d90cb2e9744a2ebd55dcbee90cdb980.zip | |
Tune mfmToHtml (#7841)
* Tune mfmToHtml
* typo
* add
Diffstat (limited to 'test')
| -rw-r--r-- | test/mfm.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/mfm.ts b/test/mfm.ts index d9b98cdac3..ecf886ad6c 100644 --- a/test/mfm.ts +++ b/test/mfm.ts @@ -19,6 +19,30 @@ describe('toHtml', () => { }); describe('fromHtml', () => { + it('p', () => { + assert.deepStrictEqual(fromHtml('<p>a</p><p>b</p>'), 'a\n\nb'); + }); + + it('block element', () => { + assert.deepStrictEqual(fromHtml('<div>a</div><div>b</div>'), 'a\nb'); + }); + + it('inline element', () => { + assert.deepStrictEqual(fromHtml('<ul><li>a</li><li>b</li></ul>'), 'a\nb'); + }); + + it('block code', () => { + assert.deepStrictEqual(fromHtml('<pre><code>a\nb</code></pre>'), '```\na\nb\n```'); + }); + + it('inline code', () => { + assert.deepStrictEqual(fromHtml('<code>a</code>'), '`a`'); + }); + + it('quote', () => { + assert.deepStrictEqual(fromHtml('<blockquote>a\nb</blockquote>'), '> a\n> b'); + }); + it('br', () => { assert.deepStrictEqual(fromHtml('<p>abc<br><br/>d</p>'), 'abc\n\nd'); }); |