Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,36 @@ public function testListFistTekstOnNewLine(): void
);
}

public function testNestedList(): void
{
$input = <<<'INPUT'
* This is an item with sub items

* A valid
* subitem
* list

INPUT;
$context = $this->createContext($input);

$result = $this->rule->apply($context);

self::assertEquals(
new ListNode(
[
new ListItemNode('*', false, [
new RawNode('This is an item with sub items

* A valid
* subitem
* list'),
]),
],
),
$result,
);
}

public function testListWithOddIndenting(): void
{
$input = <<<'INPUT'
Expand Down
13 changes: 13 additions & 0 deletions tests/Functional/tests/list-nested/list-nested.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<p>To create a bullet list:</p>
<ul>
<li>add a blank line before and after the list</li>
<li>indent the list item text by 4 spaces - including the item sign</li>
<li>
<p>to create a nested list:</p>
<ul>
<li>indent the items by 4 spaces (left-align with parent item text)</li>
<li>apply rules of parent list (blank lines, item text indentation, ..)</li>
</ul>
</li>
</ul>
<p>More text.</p>
10 changes: 10 additions & 0 deletions tests/Functional/tests/list-nested/list-nested.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
To create a bullet list:

* add a blank line before and after the list
* indent the list item text by 4 spaces - including the item sign
* to create a nested list:

* indent the items by 4 spaces (left-align with parent item text)
* apply rules of parent list (blank lines, item text indentation, ..)

More text.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<p>To create a numbered list:</p>
<ol>
<li>add a blank line before and after the list</li>
<li>indent the list item text by 4 spaces - including the item sign</li>
<li>
<p>to create a nested list:</p>
<ol>
<li>indent the items by 4 spaces (left-align with parent item text)</li>
<li>apply rules of parent list (blank lines, item text indentation, ..)</li>
</ol>
</li>
</ol>
<p>More text.</p>
10 changes: 10 additions & 0 deletions tests/Functional/tests/list-ordered-nested/list-ordered-nested.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
To create a numbered list:

#. add a blank line before and after the list
#. indent the list item text by 4 spaces - including the item sign
#. to create a nested list:

#. indent the items by 4 spaces (left-align with parent item text)
#. apply rules of parent list (blank lines, item text indentation, ..)

More text.