List becomes header


#1

If I type

- first
  -

into the dingus. It makes “First” an h2 element. Is this expected?

http://spec.commonmark.org/dingus/?text=-%20first%20%20-


#2

There is no <h2> tag in the example that you linked to; I see that pasting the text exactly produces an <h2> though. This appears to be intentional since a string of characters with one or more hyphens on the next line is a setext-style header.


#3

Is this expected?

Yes.

The first line of

- first

is prefixed with a hyphen which makes a bulleted list.

The second line of

  -

acts as a second line to the contents of the list. That means the contents of the <li> gets evaluated as

first
-

which is a setext heading for <h2>.


#4

The permalink on the dingus doesn’t seem to know how to save this example. Bummer.


#5

Example 63 in the spec. suggests that the hyphen should continue the list, not act as a setext header.


#6

I don’t follow. Are you sure that Example 63 is the one you meant?

- Foo
---

is shown to produce

<ul>
<li>Foo</li>
</ul>
<hr />

which doesn’t “suggest that the hyphen should continue the list” in any way.


#7

You’re right. I missed the hr at the end. Still don’t understand why an indented hyphen on the second line behaves like a header.