mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-11 18:02:26 +03:00
fix(296): parse with lost repeated closing tag (#297)
* fix: extract node list ot separate file, fix nested parsing * chore: node list tests * fix: nested tags parsing * chore: changeset * chore: remove unused files * chore: disable publish on every commit
This commit is contained in:
@@ -962,6 +962,36 @@ sdfasdfasdf
|
||||
);
|
||||
});
|
||||
|
||||
test('parse with lost repeated closing tag', () => {
|
||||
const input = parse('Hello World[u]Wrong underline[u] This is another text [u]and this, too[/u]');
|
||||
|
||||
expect(input).toBeMatchAST([
|
||||
'Hello',
|
||||
' ',
|
||||
'World',
|
||||
'[u]',
|
||||
'Wrong',
|
||||
' ',
|
||||
'underline',
|
||||
'[u]',
|
||||
' ',
|
||||
'This',
|
||||
' ',
|
||||
'is',
|
||||
' ',
|
||||
'another',
|
||||
' ',
|
||||
'text',
|
||||
' ',
|
||||
{
|
||||
tag: 'u',
|
||||
attrs: {},
|
||||
content: ['and', ' ', 'this,', ' ', 'too'],
|
||||
}
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
test('parse with url in tag content', () => {
|
||||
const input = parse('[img]https://tw.greywool.com/i/e3Ph5.png[/img]');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user