diff --git a/samples/Sample_26_Html.php b/samples/Sample_26_Html.php
index 69d9d131..b05f8d08 100644
--- a/samples/Sample_26_Html.php
+++ b/samples/Sample_26_Html.php
@@ -29,10 +29,13 @@ $html .= '
- List 2 item 1
- List 2 item 2
-
- - sub list 1
- - sub list 2
-
+ -
+
+ - sub list 1
+ - sub list 2
+
+
+
- List 2 item 3
- sub list 1, restarts with a
diff --git a/tests/PhpWord/Shared/HtmlTest.php b/tests/PhpWord/Shared/HtmlTest.php
index 6122924f..936c35f9 100644
--- a/tests/PhpWord/Shared/HtmlTest.php
+++ b/tests/PhpWord/Shared/HtmlTest.php
@@ -272,6 +272,43 @@ class HtmlTest extends \PHPUnit\Framework\TestCase
$this->assertNotEquals($firstListnumId, $secondListnumId);
}
+ /**
+ * Tests parsing of nested ul/li
+ */
+ public function testOrderedNestedListNumbering()
+ {
+ $phpWord = new \PhpOffice\PhpWord\PhpWord();
+ $section = $phpWord->addSection();
+ $html = '
+ - List 1 item 1
+ - List 1 item 2
+
+ Some Text
+
+ - List 2 item 1
+ -
+
+ - sub list 1
+ - sub list 2
+
+
+
';
+ Html::addHtml($section, $html, false, false);
+
+ $doc = TestHelperDOCX::getDocument($phpWord, 'Word2007');
+ echo $doc->printXml();
+ $this->assertTrue($doc->elementExists('/w:document/w:body/w:p/w:pPr/w:numPr/w:numId'));
+ $this->assertTrue($doc->elementExists('/w:document/w:body/w:p/w:r/w:t'));
+
+ $this->assertEquals('List 1 item 1', $doc->getElement('/w:document/w:body/w:p[1]/w:r/w:t')->nodeValue);
+ $this->assertEquals('List 2 item 1', $doc->getElement('/w:document/w:body/w:p[4]/w:r/w:t')->nodeValue);
+
+ $firstListnumId = $doc->getElementAttribute('/w:document/w:body/w:p[1]/w:pPr/w:numPr/w:numId', 'w:val');
+ $secondListnumId = $doc->getElementAttribute('/w:document/w:body/w:p[4]/w:pPr/w:numPr/w:numId', 'w:val');
+
+ $this->assertNotEquals($firstListnumId, $secondListnumId);
+ }
+
/**
* Tests parsing of ul/li
*/