showdownjs / showdown

A bidirectional Markdown to HTML to Markdown converter written in Javascript
http://www.showdownjs.com/
MIT License
14.28k stars 1.56k forks source link

Unordered List with Headings #495

Closed limaneto closed 6 years ago

limaneto commented 6 years ago

Hi, thanks for providing this lib !! I think I spotted a minor bug. The last heading does not get converted to a Heading after running makeHtml function.

screen shot 2018-01-27 at 13 57 03 screen shot 2018-01-27 at 13 56 30
tivie commented 6 years ago

humm... This one is "interesting".

The "correct" way of doing this should be:

- Increase the number of water changes.

- #### Protein skimmers:

    This remove dissolved...

- #### Chemical filter media:

    When placed in your filter, ...

Why? Because in lists, blocks should be separated by an empty line and indented four spaces. (Both header and paragraph are blocks)

Outside lists, blocks should also be separated by an empty line. The only exception to this rule are headers.

So, you have 2 syntax rules that clash with eachother.

IMHO, users expect that headers, in this regard, work the same way inside and outside list blocks.

So we probably should treat this as a "bug" (mostly because GFM supports your syntax style)

tivie commented 6 years ago

Should be fixed now