neocotic / europa

Library for converting HTML into valid Markdown
MIT License
159 stars 24 forks source link

Better lists #22

Closed neocotic closed 11 years ago

neocotic commented 11 years ago

Improved the support for ordered and unordered list translation and added support for nested lists.

The following are all generated from the expected HTML:

Simple ordered list

1. ordered-item1
2. ordered-item2
3. ordered-item3

Simple unordered list

* unordered-item1
* unordered-item2
* unordered-item3

Nested ordered list

1. ordered-item1
2. ordered-item2
  1. ordered-sub-item1
  2. ordered-sub-item2
  3. ordered-sub-item3
3. ordered-item3

Nested unordered list

* unordered-item1
* unordered-item2
  * unordered-sub-item1
  * unordered-sub-item2
  * unordered-sub-item3
* unordered-item3

Mixed nested list 1

* unordered-item1
* unordered-item2
  1. ordered-sub-item1
  2. ordered-sub-item2
  3. ordered-sub-item3
* unordered-item3

Mixed nested list 2

1. ordered-item1
2. ordered-item2
  * unordered-sub-item1
  * unordered-sub-item2
  * unordered-sub-item3
3. ordered-item3

A new test fixture has been added for this functionality.