Closed Alteras1 closed 1 year ago
Could we just .toLowerCase() anything entered in brackets?
Edit: Realized this is more about where to fix this rather than how.
So just like you said, the allowed tags mode is what's causing the issue.
* @private
* @param {String} value
* @return {boolean}
*/ const isAllowedTag = (value)=>{
if (options.onlyAllowTags && options.onlyAllowTags.length) {
return options.onlyAllowTags.indexOf(value) >= 0;
}
return true;
};
Because the toTagNode() function already has a .toLowerCase in it
toTagNode() {
return new TagNode(this.tag.toLowerCase(), this.attrs, this.content);
}
So adding .toLowerCase() here:
if (options.onlyAllowTags && options.onlyAllowTags.length) {
return options.onlyAllowTags.indexOf(value.**toLowerCase()**) >= 0;
}
Gives us the right output.
So we could either, copy the entire parser code from bbob, change this line, and import it as an option during the bbob call. Or we could, as you said, make a suggestion on the bbob repo.
I went ahead and opened an issue on the BBob GitHub. https://github.com/JiLiZART/BBob/issues/190#issue-1912564626
I went ahead and opened an issue on the BBob GitHub. JiLiZART/BBob#190 (comment)
It seems like its going to get fixed on BBob, pretty hype.
The fix has been merged into BBob
BBob doesn't seem to support case insensitive tags. Might need to make suggestion/open PR on BBob's repo. Could also consider removing the allowed tags mode and do a custom bbob plugin to walk the tree similar to how we already do with newlines.