mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-08 17:22:26 +03:00
* fix(preset-html5): add color tag #189 * fix(parser): case insensitive tags bug #190
This commit is contained in:
@@ -20,6 +20,9 @@ const parse = (input, opts = {}) => {
|
||||
const options = opts;
|
||||
const openTag = options.openTag || OPEN_BRAKET;
|
||||
const closeTag = options.closeTag || CLOSE_BRAKET;
|
||||
const onlyAllowTags = (options.onlyAllowTags || [])
|
||||
.filter(Boolean)
|
||||
.map((tag) => tag.toLowerCase());
|
||||
|
||||
let tokenizer = null;
|
||||
|
||||
@@ -83,8 +86,8 @@ const parse = (input, opts = {}) => {
|
||||
* @return {boolean}
|
||||
*/
|
||||
const isAllowedTag = (value) => {
|
||||
if (options.onlyAllowTags && options.onlyAllowTags.length) {
|
||||
return options.onlyAllowTags.indexOf(value) >= 0;
|
||||
if (onlyAllowTags.length) {
|
||||
return onlyAllowTags.indexOf(value.toLowerCase()) >= 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user