diff --git a/lib/rules.js b/lib/rules.js index f1d89691..f1a900f2 100644 --- a/lib/rules.js +++ b/lib/rules.js @@ -766,15 +766,16 @@ module.exports = [ "aliases": [ "blanks-around-lists" ], "regexp": null, "func": function MD032(params, errors) { + var blankOrListRe = /^[\s>]*($|\s)/; var inList = false; var prevLine = ""; forEachLine(params, function forLine(line, lineIndex, inCode, onFence) { if (!inCode || onFence) { var lineTrim = line.trim(); var listMarker = listItemMarkerRe.test(lineTrim); - if (listMarker && !inList && !/^($|\s)/.test(prevLine)) { + if (listMarker && !inList && !blankOrListRe.test(prevLine)) { errors.addContext(lineIndex + 1, lineTrim); - } else if (!listMarker && inList && !/^($|\s)/.test(line)) { + } else if (!listMarker && inList && !blankOrListRe.test(line)) { errors.addContext(lineIndex, lineTrim); } inList = listMarker; diff --git a/test/lists-in-blockquote.md b/test/lists-in-blockquote.md index 6c949ded..8982ac27 100644 --- a/test/lists-in-blockquote.md +++ b/test/lists-in-blockquote.md @@ -62,3 +62,30 @@ Text > * Item >>* Item >> * Item + +Text + +> Quoted text +> +> * A list +> * of items +> +> More quoted text + +Text + +> Quoted text +> +> > * A list +> > * of items +> +> More quoted text + +Text + +> Quoted text +> +> > * A list +> > * of items +> > +> > More quoted text