diff --git a/lib/common/html_blocks.js b/lib/common/html_blocks.js index 97fb1e6..91f5f3b 100644 --- a/lib/common/html_blocks.js +++ b/lib/common/html_blocks.js @@ -3,8 +3,9 @@ 'use strict'; +var html_blocks = {}; -module.exports = [ +[ 'article', 'aside', 'button', @@ -55,4 +56,7 @@ module.exports = [ 'thead', 'ul', 'video' -]; +].forEach(function (name) { html_blocks[name] = true; }); + + +module.exports = html_blocks; diff --git a/lib/rules_block/htmlblock.js b/lib/rules_block/htmlblock.js index 9d4ef96..f067d71 100644 --- a/lib/rules_block/htmlblock.js +++ b/lib/rules_block/htmlblock.js @@ -48,7 +48,7 @@ module.exports = function htmlblock(state, startLine, endLine, silent) { if (!match) { return false; } } // Make sure tag name is valid - if (block_names.indexOf(match[1].toLowerCase()) < 0) { return false; } + if (block_names[match[1].toLowerCase()] !== true) { return false; } if (silent) { return true; } } else {