diff --git a/lib/marked.js b/lib/marked.js index 03251f3c58..46500bc35b 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -315,9 +315,10 @@ Lexer.prototype.token = function(src, top, bq) { // Determine whether the next list item belongs here. // Backpedal if it does not belong in this list. - if (this.options.smartLists && i !== l - 1) { + if (i !== l - 1) { b = block.bullet.exec(cap[i + 1])[0]; - if (bull !== b && !(bull.length > 1 && b.length > 1)) { + if (bull.length > 1 ? b.length == 1 + : (b.length > 1 || (this.options.smartLists && b !== bull))) { src = cap.slice(i + 1).join('\n') + src; i = l - 1; } diff --git a/test/new/adjacent_lists.html b/test/new/adjacent_lists.html new file mode 100644 index 0000000000..b4cd8f5086 --- /dev/null +++ b/test/new/adjacent_lists.html @@ -0,0 +1,9 @@ + + +
    +
  1. This should be
  2. +
  3. An unordered list
  4. +
diff --git a/test/new/adjacent_lists.text b/test/new/adjacent_lists.text new file mode 100644 index 0000000000..3fd460b3d7 --- /dev/null +++ b/test/new/adjacent_lists.text @@ -0,0 +1,5 @@ +* This should be +* An unordered list + +1. This should be +2. An unordered list diff --git a/test/tests/adjacent_lists.html b/test/tests/adjacent_lists.html new file mode 100644 index 0000000000..b4cd8f5086 --- /dev/null +++ b/test/tests/adjacent_lists.html @@ -0,0 +1,9 @@ + + +
    +
  1. This should be
  2. +
  3. An unordered list
  4. +
diff --git a/test/tests/adjacent_lists.text b/test/tests/adjacent_lists.text new file mode 100644 index 0000000000..3fd460b3d7 --- /dev/null +++ b/test/tests/adjacent_lists.text @@ -0,0 +1,5 @@ +* This should be +* An unordered list + +1. This should be +2. An unordered list