Update all rules to better handle wrongly-typed configuration parameters.

This commit is contained in:
David Anson 2020-01-25 18:40:39 -08:00
parent 26ad0550ec
commit 3238ed4249
25 changed files with 134 additions and 39 deletions

View file

@ -18,8 +18,9 @@ module.exports = {
"description": "Inline HTML",
"tags": [ "html" ],
"function": function MD033(params, onError) {
const allowedElements = (params.config.allowed_elements || [])
.map((element) => element.toLowerCase());
let allowedElements = params.config.allowed_elements;
allowedElements = Array.isArray(allowedElements) ? allowedElements : [];
allowedElements = allowedElements.map((element) => element.toLowerCase());
forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
let match = null;
// eslint-disable-next-line no-unmodified-loop-condition