Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

showndown doesnt translate correctly ordored list to html. #158

Closed
be-next-hotdog opened this issue Jun 3, 2015 · 6 comments
Closed

showndown doesnt translate correctly ordored list to html. #158

be-next-hotdog opened this issue Jun 3, 2015 · 6 comments
Assignees

Comments

@be-next-hotdog
Copy link

While i was trying to input an ordered list as follow :

  1. some text
  2. some text
  3. some text

showdown would transfer these to an unordered list in html :

  • some text
  • some text
  • some text

eventually a bug ? Or showdown is not able to differentiate ordered list and unordered list ?

@tivie
Copy link
Member

tivie commented Jun 3, 2015

@be-next-hotdog showdown does indeed support ordered lists. In fact i could not reproduce the bug you described. Can you provide more context?

Heres a working fiddle with showdown parsing correctly a ordered list...
http://jsfiddle.net/7reex9sq/1/

@tivie tivie self-assigned this Jun 3, 2015
@be-next-hotdog
Copy link
Author

For the test cases :

Test case 1 :

  • Foo
  • Bar
  • Baz
  1. Foo
  2. Bar
  3. Baz

Transformation result 1:

  • Foo
  • Bar
  • Baz
  • Foo
  • Bar
  • Baz

Test case 2 :

  1. Foo
  2. Bar
  3. Baz
  • Foo
  • Bar
  • Baz

Transformation result 2 :

  1. Foo
  2. Bar
  3. Baz
  4. Foo
  5. Bar
  6. Baz

It seems like that showdown will transform to ordered / unordered list according to the first list element type. Otherwise caused by definition of markdown syntax ? I couldn't put these 2 kinds of etiquette (star/number) in the same list ? Thx a lot.

@8Miles-Mai
Copy link

yeap.
But we can do like this:

  1. 1
  2. 2
  3. 3

#like this, add an list separator

  • 1
  • 2
  • 3

@tivie
Copy link
Member

tivie commented Jun 4, 2015

@be-next-hotdog yes, this is a known bug/gotcha/feature (we haven't really decided was that is).

John Gruber's (the markdown creator) lib had this odd behavior. According to the author, it is in fact intended. I doubt it... but we haven't yet decided to "fix" this since we want to adhere to the original spec as much as possible.

As a workaround, you can add any character bewteen the 2 lists (as @8Miles-Mai suggested).

@tivie tivie added the duplicate label Jun 4, 2015
@tivie
Copy link
Member

tivie commented Jun 4, 2015

Duplicate of #142

@tivie tivie closed this as completed Jun 4, 2015
@be-next-hotdog
Copy link
Author

Yepp, I knew this solution before, and we could also type a space to each element as :

  • test
  • test
    1. test
    2. test

in this case, the showdown will regard the second ordered list as a sublist. StackEdit follows this rule either, also the github comment tool which we use here.

Thx all the same guys !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants