mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-14 18:42:24 +03:00
* fix: test for buggy behavior * feat: implement whitespaceInTags mode * feat: move all char arrays to Map * feat: revert Map for char arrays
This commit is contained in:
@@ -869,6 +869,43 @@ sdfasdfasdf
|
||||
]);
|
||||
});
|
||||
|
||||
test('parse invalid tags', () => {
|
||||
const input = parse('[b]Press Release[/b] [statement redacted] [i]This is more content[/i]', {
|
||||
whitespaceInTags: false
|
||||
})
|
||||
|
||||
expectOutput(input, [
|
||||
{
|
||||
tag: 'b',
|
||||
attrs: {},
|
||||
content: [
|
||||
'Press',
|
||||
' ',
|
||||
'Release'
|
||||
],
|
||||
},
|
||||
' ',
|
||||
'[',
|
||||
'statement',
|
||||
' ',
|
||||
'redacted]',
|
||||
' ',
|
||||
{
|
||||
tag: 'i',
|
||||
attrs: {},
|
||||
content: [
|
||||
'This',
|
||||
' ',
|
||||
'is',
|
||||
' ',
|
||||
'more',
|
||||
' ',
|
||||
'content'
|
||||
],
|
||||
},
|
||||
]);
|
||||
})
|
||||
|
||||
describe('html', () => {
|
||||
const parseHTML = (input: string) => parse(input, { openTag: '<', closeTag: '>' });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user