2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-06-17 19:21:20 +03:00

quoted bbcode params support, support escape backslash

This commit is contained in:
Nikolay Kostyurin
2018-07-06 00:33:49 +02:00
parent e1e9874642
commit 12144415cc
6 changed files with 144 additions and 18 deletions
+17
View File
@@ -36,4 +36,21 @@ describe('Parser', () => {
},
]);
});
test('parse tag with quoted param with spaces', () => {
const ast = parse('[url href=https://ru.wikipedia.org target=_blank text="Foo Bar"]Text[/url]');
expect(ast).toBeInstanceOf(Array);
expect(ast).toEqual([
{
tag: 'url',
attrs: {
href: 'https://ru.wikipedia.org',
target: '_blank',
text: 'Foo Bar',
},
content: ['Text'],
},
]);
});
});