2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-06-11 18:02:26 +03:00

fix: treat contextFreeTags case insensitively (#230)

This commit is contained in:
Steven Chang
2024-04-14 06:02:29 -07:00
committed by GitHub
parent 4f9729c59f
commit 05246b2aea
3 changed files with 27 additions and 2 deletions
+18
View File
@@ -482,6 +482,24 @@ describe('lexer', () => {
expect(tokens).toBeMantchOutput(output);
})
test('context free tag case insensitive [CODE]', () => {
const input = '[CODE] [b]some string[/b][/CODE]'
const tokens = tokenizeContextFreeTags(input, ['code']);
const output = [
[TYPE.TAG, 'CODE', 0, 0],
[TYPE.SPACE, ' ', 0, 0],
[TYPE.WORD, '[', 0, 0],
[TYPE.WORD, 'b]some', 0, 0],
[TYPE.SPACE, ' ', 0, 0],
[TYPE.WORD, 'string', 0, 0],
[TYPE.WORD, '[', 0, 0],
[TYPE.WORD, '/b]', 0, 0],
[TYPE.TAG, '/CODE', 0, 0],
]
expect(tokens).toBeMantchOutput(output);
})
test('bad closed tag with escaped backslash', () => {
const input = `[b]test[\\b]`;
const tokens = tokenizeEscape(input);