summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMeiMei <30769358+mei23@users.noreply.github.com>2021-09-26 01:57:38 +0900
committerGitHub <noreply@github.com>2021-09-26 01:57:38 +0900
commitece3ac967d90cb2e9744a2ebd55dcbee90cdb980 (patch)
treea2e67f35251d27417345f898a311595c9330c489 /test
parentfix(client): fix tabs of page header behaviour (diff)
downloadsharkey-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.ts24
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');
});