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:
@@ -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'],
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user