Merge branch 'develop' of https://github.com/syuilo/misskey into ci
This commit is contained in:
commit
70a68045e2
203 changed files with 3272 additions and 1949 deletions
34
test/mfm.ts
34
test/mfm.ts
|
@ -804,6 +804,14 @@ describe('MFM', () => {
|
|||
]);
|
||||
});
|
||||
|
||||
it('ignore trailing periods', () => {
|
||||
const tokens = parse('https://example.com...');
|
||||
assert.deepStrictEqual(tokens, [
|
||||
leaf('url', { url: 'https://example.com' }),
|
||||
text('...')
|
||||
]);
|
||||
});
|
||||
|
||||
it('with comma', () => {
|
||||
const tokens = parse('https://example.com/foo?bar=a,b');
|
||||
assert.deepStrictEqual(tokens, [
|
||||
|
@ -1116,6 +1124,14 @@ describe('MFM', () => {
|
|||
], {}),
|
||||
]);
|
||||
});
|
||||
|
||||
// https://misskey.io/notes/7u1kv5dmia
|
||||
it('ignore internal tilde', () => {
|
||||
const tokens = parse('~~~~~');
|
||||
assert.deepStrictEqual(tokens, [
|
||||
text('~~~~~')
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('italic', () => {
|
||||
|
@ -1173,6 +1189,24 @@ describe('MFM', () => {
|
|||
text('foo_bar_baz'),
|
||||
]);
|
||||
});
|
||||
|
||||
it('require spaces', () => {
|
||||
const tokens = parse('4日目_L38b a_b');
|
||||
assert.deepStrictEqual(tokens, [
|
||||
text('4日目_L38b a_b'),
|
||||
]);
|
||||
});
|
||||
|
||||
it('newline sandwich', () => {
|
||||
const tokens = parse('foo\n_bar_\nbaz');
|
||||
assert.deepStrictEqual(tokens, [
|
||||
text('foo\n'),
|
||||
tree('italic', [
|
||||
text('bar')
|
||||
], {}),
|
||||
text('\nbaz'),
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue