Hello there!
I noticed a little bug. I was trying to write a nested list, like this one:

* Item One
* Item Two
    1. Item One
    2. Item Two
* Item Three

I'm not sure this is related, it appears almost fine in the preview box, but it adds automatically an empty line between 1. Item One and 2. Item Two:

34cf556f9e043dc5398697d618224786

When going to submit I get this error:

The code snippet in your post is formatted incorrectly. Please use the Code button in the editor toolbar when posting whitespace-sensitive text or curly braces.

Also, I thought the absence of an empty line before and after a presumed "code block" as a nested list, would have avoided the check.

Recommended Answers

All 2 Replies

it adds automatically an empty line between 1. Item One and 2. Item Two

Yes, that's a quirk or the Markdown formatting that I've been unable to fix without introducing other quirks.

When going to submit I get this error:

Yup, that's because you indented the nested items with a tab or 4+ spaces. Markdown will accept the nesting regardless of source text indentation, so you can just ignore it and leave everything at column 0. However, if you want to have nested lists of the same type, you can use a 1, 2, or 3 space indentation to give a hint to the parser and still get around our code validation. Here's an example with 2 spaces:

* Item One
* Item Two
  * Nested One
  * Nested Two
* Item Three

Which is formatted like this:

  • Item One
  • Item Two

    • Nested One
    • Nested Two
  • Item Three

Also, I thought the absence of an empty line before and after a presumed "code block" as a nested list, would have avoided the check.

No, that ensures that you'll get an error. ;) The editor will not format such text as code, but the validation runs after you try to submit.

Pretty clear, thank you for the hints!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.