2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-06-08 17:22: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
+4 -2
View File
@@ -63,7 +63,9 @@ function createLexer(buffer, options = {}) {
const openTag = options.openTag || OPEN_BRAKET;
const closeTag = options.closeTag || CLOSE_BRAKET;
const escapeTags = !!options.enableEscapeTags;
const contextFreeTags = options.contextFreeTags || [];
const contextFreeTags = (options.contextFreeTags || [])
.filter(Boolean)
.map((tag) => tag.toLowerCase());
const onToken = options.onToken || (() => {
});
@@ -92,7 +94,7 @@ function createLexer(buffer, options = {}) {
contextFreeTag = '';
}
if (contextFreeTag === '' && contextFreeTags.includes(name)) {
if (contextFreeTag === '' && contextFreeTags.includes(name.toLowerCase())) {
contextFreeTag = name;
}
};