Skip to content

Markdown Nesting

Desislava Mihaylova edited this page May 27, 2022 · 2 revisions

This article provides some tips and tricks about nesting elements in lists by using Markdown.

Nesting Lists

Basically, to nest an element inside a list item, use indentation.

Example 1: Nesting unordered lists

* Unordered list:
	* Nested unordered list.
	* Second list item.
* Root item.

Result

  • Unordered list:
    • Nested unordered list.
    • Second list item.
  • Root item.

Example 2: Nesting ordered lists

1. Ordered list:
	1. Nested ordered list.
	1. Second list item.
1. Root item.

Result

  1. Ordered list:
    1. Nested ordered list.
    2. Second list item.
  2. Root item.

Nesting Images

Note that the images are inline elements and adding them only with one carriage return will add them to the same list item. To add an image as if it is nested, add one more empty line (that is, create a new paragraph inside the list item).


Example 3: Nesting an image
* Inline image:
	![Image Description](./images/html5-logo-icon.png)	
* Nested image:
	
	![Image Description](./images/html5-logo.png)
* Additional list item.

Result

  • Inline image: Image Description

  • Nested image:

    Image Description

  • Additional list item.


Nesting Tables

To nest a table, add indentation to all table rows.


Example 4: Nesting a table
1. A list item with a table

	|Title|Title|
	|-----|-----|
	|cell |cell |

1. A second list item

Result

  1. A list item with a table

    Title Title
    cell cell
  2. A second list item


Nesting Code Snippets

The custom code snippets cannot be nested inside a list item. However, the native MarkDown ones can.

It is important to always add a fake title that hints what is the code in the code snippet.


Example 5: Nesting code snippets
1. A list item with a code snippet

	**ASP.NET**
	    
	    <telerik:RadButton runat="server" ID="RadButton1" OnClientClicking="OnClientClicking">
	    </telerik:RadButton>

1. Second list item

Result

  1. A list item with a code snippet

    ASP.NET

     <telerik:RadButton runat="server" ID="RadButton1" OnClientClicking="OnClientClicking">
     </telerik:RadButton>
    
  2. Second list item