Skip to content
DKaramfilov edited this page Dec 16, 2015 · 1 revision

Here you can find some tips about nesting elements in lists with Markdown.

Nesting Lists

Basically, to nest an element inside a list item via Markdown, you should 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

It is important to note that the images are inline elements, and adding them only with one carriage return will add them in the same list item. If you need to add the image as if it is nested, add one more new line (i.e., 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

Nesting a table can be achieved by adding indentation to all table rows.


Example 4: Nesting a table
1. List item with table

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

1. Second list item

Result:

  1. List item with table

    Title Title
    cell cell
  2. 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. List item with code snippet

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

1. Second list item

Result:

  1. List item with code snippet

    ASP.NET

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


Clone this wiki locally