diff --git a/lib/rules.js b/lib/rules.js index 84a81984..613d0800 100644 --- a/lib/rules.js +++ b/lib/rules.js @@ -936,13 +936,17 @@ module.exports = [ function base(token) { if (token.type === "paragraph_open") { return function inParagraph(t) { - if ((t.type === "inline") && - (t.children.length === 3) && - ((t.children[0].type === "strong_open") || - (t.children[0].type === "em_open")) && - (t.children[1].type === "text") && - !re.test(t.children[1].content)) { - errors.addContext(t.lineNumber, t.children[1].content); + // Always paragraph_open/inline/paragraph_close, + // omit (t.type === "inline") + var children = t.children.filter(function notEmptyText(child) { + return (child.type !== "text") || (child.content !== ""); + }); + if ((children.length === 3) && + ((children[0].type === "strong_open") || + (children[0].type === "em_open")) && + (children[1].type === "text") && + !re.test(children[1].content)) { + errors.addContext(t.lineNumber, children[1].content); } return base; }; diff --git a/package.json b/package.json index 3629105e..d23d8df2 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "example": "cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint" }, "dependencies": { - "markdown-it": "8.3.2" + "markdown-it": "8.4.0" }, "devDependencies": { "browserify": "^14.5.0",