2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-06-11 18:02:26 +03:00

fix(parser): tokenizer error with quotemark strings

This commit is contained in:
Nikolay Kostyurin
2018-07-11 23:37:51 +02:00
parent 3119314b07
commit 7f400506d4
6 changed files with 64 additions and 6 deletions
+24
View File
@@ -42,6 +42,30 @@ describe('Parser', () => {
]);
});
test('parse inconsistent tags', () => {
const ast = parse('[h1 name=value]Foo [Bar] /h1]');
expect(ast).toBeInstanceOf(Array);
expect(ast).toEqual(
[
{
attrs: {},
tag: 'h1',
content: []
},
'Foo',
' ',
{
tag: 'Bar',
attrs: {},
content: []
},
' ',
'/h1',
]
);
});
test('parse tag with value param', () => {
const ast = parse('[url=https://github.com/jilizart/bbob]BBob[/url]');