mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-14 18:42:24 +03:00
feat(parse): allow tags to be escaped with backslash (#17)
* feat(parse): allow tags to be escaped with backslash adds additional option `enableEscapeTags` to `parse` and `createLexer` that when true will parse openTag and closeTag as WORD (rather than TAG) when proceeded with backslash
This commit is contained in:
committed by
Nikolay Kostyurin
parent
7e25c45c83
commit
c4f78c1230
@@ -183,5 +183,21 @@ describe('Parser', () => {
|
||||
}
|
||||
]);
|
||||
});
|
||||
|
||||
test('parse escaped tags tags', () => {
|
||||
const ast = parse('\\[b\\]test\\[/b\\]', {
|
||||
enableEscapeTags: true
|
||||
});
|
||||
|
||||
expectOutput(ast, [
|
||||
'[',
|
||||
'b',
|
||||
']',
|
||||
'test',
|
||||
'[',
|
||||
'/b',
|
||||
']',
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user