[MFM] Better syntax parsing

Allow nesting by same tag
This commit is contained in:
syuilo 2019-01-31 12:23:45 +09:00
parent bb92158dff
commit b515cc90e9
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
2 changed files with 18 additions and 3 deletions

View file

@ -276,6 +276,21 @@ describe('MFM', () => {
}),
]);
});
it('nested', () => {
const tokens = parse('<spin><spin>:foo:</spin></spin>');
assert.deepStrictEqual(tokens, [
tree('spin', [
tree('spin', [
leaf('emoji', { name: 'foo' })
], {
attr: null
}),
], {
attr: null
}),
]);
});
});
it('jump', () => {