gettalong / kramdown

kramdown is a fast, pure Ruby Markdown superset converter, using a strict syntax definition and supporting several common extensions.
http://kramdown.gettalong.org
Other
1.72k stars 274 forks source link

Not possible to put a table within an ordered list #695

Closed hiteshsharma closed 3 years ago

hiteshsharma commented 3 years ago

I'm trying to put a table within an ordered list but a table requires previous and next lines to be empty but that breaks the ordered list numbering. Any suggestions how to fix this or is it a bug?

1. line1

  :------------------------------------------: |:-------------------------------------------------:
  hello | world

2. line 2

This renders

1. line 1

expected table

1. line 2

if I remove the empty lines from before and after the table, then the table doesn't renders and all the table text becomes part of line 1 but line 2 renders with number 2 as expected. I'm unable to find a way to render the table and still keep the ordered list numbering intact. Thanks for the help!

gettalong commented 3 years ago

You need to use the right amount of indentation:

1. line1

   :------------------------------------------: |:-------------------------------------------------:
   hello | world

2. line 2

See the syntax reference for details.