From a7510b97e7a087e4e10f2ad92ab3c1548dc73b20 Mon Sep 17 00:00:00 2001 From: Emanuil Rusev Date: Fri, 31 Jan 2014 03:03:52 +0200 Subject: [PATCH] dense list items that follow sparse ones should not be rendered as sparse ones --- Parsedown.php | 5 +++-- tests/data/sparse_dense_list.html | 7 +++++++ tests/data/sparse_dense_list.md | 4 ++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 tests/data/sparse_dense_list.html create mode 100644 tests/data/sparse_dense_list.md diff --git a/Parsedown.php b/Parsedown.php index 610cc7a..6690451 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -200,13 +200,14 @@ class Parsedown $blocks []= $block; - unset($block['first']); - $block['last'] = true; $block['lines'] = array(); $block['lines'] []= preg_replace('/^[ ]{0,4}/', '', $matches[1]); + unset($block['first']); + unset($block['interrupted']); + continue 2; } diff --git a/tests/data/sparse_dense_list.html b/tests/data/sparse_dense_list.html new file mode 100644 index 0000000..095bc73 --- /dev/null +++ b/tests/data/sparse_dense_list.html @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/tests/data/sparse_dense_list.md b/tests/data/sparse_dense_list.md new file mode 100644 index 0000000..5768422 --- /dev/null +++ b/tests/data/sparse_dense_list.md @@ -0,0 +1,4 @@ +- li + +- li +- li \ No newline at end of file