Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Separate lists in markdown

Tags:

list

markdown

It is possible to have two different list (one next to the other) in Markdown without an horizontal ruler?

  • Element 1
  • Element 2
  • Element 3

  • Elelemt 1
  • Element 2
like image 217
Luis Veliz Avatar asked Dec 18 '16 16:12

Luis Veliz


People also ask

How to write nested lists in markdown?

To nest one list within another, indent each item in the sublist by four spaces. You can also nest other elements like paragraphs, blockquotes or code blocks. You can mix ordered and unordered lists. To nest a paragraph or blockquote, indent by either 4 spaces or one tab.

How to create lists in markdown?

To create an unordered list, add dashes ( - ), asterisks ( * ), or plus signs ( + ) in front of line items. Indent one or more items to create a nested list.


3 Answers

I usually use an HTML comment to break up adjacent lists, e.g.:

1. One
1. Two

<!-- -->

1. One
1. Two

On Stack Overflow, and just about everywhere else I've tried, this renders as

  1. One
  2. Two
  1. One
  2. Two

I think a comment is nicer than a <br> tag since it is semantically meaningless.

like image 110
Chris Avatar answered Nov 15 '22 08:11

Chris


Not sure if there's a pure markdown way, but most parsers will allow you to use a subset of HTML tags.

- Element 1
- Element 2
- Element 3


<br />


+ Elelemt 1
+ Element 2
like image 36
Dan Prince Avatar answered Nov 15 '22 08:11

Dan Prince


I use an empty link:

- Element 1
- Element 2
- Element 3

[]()

+ Elelemt 1
+ Element 2

It just renders as empty paragraph. It's easy to type ([ ] and ( ) are close to each other) and because [] is empty, it renders as a space between lists.

  • Element 1
  • Element 2
  • Element 3

  • Elelemt 1
  • Element 2
like image 40
KamilCuk Avatar answered Nov 15 '22 10:11

KamilCuk