Skip to content

How to — Markdown Nesting

Iankodj edited this page Apr 4, 2015 · 7 revisions

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 Code Snippets


Example 3: Nesting a code snippet
1. List item with nested code:
	````JavaScript
	var grid = $find("<%= RadGrid.ClientId %>");
	`````
1. Second item

Result:

  1. List item with nested code:
    var grid = $find("<%= RadGrid.ClientId %>");
  2. Second item

Nesting Images

It is important to note down 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 image as if it is nested, add one more new line (i.e., create a new paragraph inside the list item).


Example 4: 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.


Clone this wiki locally