# List becomes header

**URL:** <https://talk.commonmark.org/t/list-becomes-header/2202>\
**Category:** Implementation\
**Created:** [August 18, 2016, 4:14pm UTC](https://talk.commonmark.org/t/list-becomes-header/2202 "2016-08-18T16:14:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Ward](https://talk.commonmark.org/user_avatar/talk.commonmark.org/mike_ward/32/520_2.png) [@Mike\_Ward](https://talk.commonmark.org/u/Mike_Ward)\
**Post date:** [August 18, 2016, 4:14pm UTC](https://talk.commonmark.org/t/list-becomes-header/2202/1 "2016-08-18T16:14:28Z")

</div>

If I type

```auto
- first
  -

```

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

> **[commonmark.js demo](https://spec.commonmark.org/dingus/?text=-%20first%20%20-)**

---

<div class="post-metadata">

**Author:** ![chrisalley](https://talk.commonmark.org/user_avatar/talk.commonmark.org/chrisalley/32/906_2.png) [@chrisalley](https://talk.commonmark.org/u/chrisalley)\
**Post date:** [August 19, 2016, 2:15am UTC](https://talk.commonmark.org/t/list-becomes-header/2202/2 "2016-08-19T02:15:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zzzzBov](https://talk.commonmark.org/user_avatar/talk.commonmark.org/zzzzbov/32/218_2.png) [@zzzzBov](https://talk.commonmark.org/u/zzzzBov)\
**Post date:** [August 19, 2016, 1:34pm UTC](https://talk.commonmark.org/t/list-becomes-header/2202/3 "2016-08-19T13:34:50Z")

</div>

> Is [this](http://spec.commonmark.org/dingus/?text=-%20first%0A%20%20-) expected?

Yes.

The first line of

```plaintext
- first

```

is prefixed with a hyphen which makes a [bulleted list](http://spec.commonmark.org/0.26/#lists).

The second line of

```auto
  -

```

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

```plaintext
first
-

```

which is a [setext heading](http://spec.commonmark.org/0.26/#setext-headings) for `<h2>`.

---

<div class="post-metadata">

**Author:** ![Mike\_Ward](https://talk.commonmark.org/user_avatar/talk.commonmark.org/mike_ward/32/520_2.png) [@Mike\_Ward](https://talk.commonmark.org/u/Mike_Ward)\
**Post date:** [August 20, 2016, 1:02am UTC](https://talk.commonmark.org/t/list-becomes-header/2202/4 "2016-08-20T01:02:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mike\_Ward](https://talk.commonmark.org/user_avatar/talk.commonmark.org/mike_ward/32/520_2.png) [@Mike\_Ward](https://talk.commonmark.org/u/Mike_Ward)\
**Post date:** [August 20, 2016, 1:06am UTC](https://talk.commonmark.org/t/list-becomes-header/2202/5 "2016-08-20T01:06:58Z")

</div>

[Example 63](http://spec.commonmark.org/0.26/#example-63) in the spec. suggests that the hyphen should continue the list, not act as a setext header.

---

<div class="post-metadata">

**Author:** ![zzzzBov](https://talk.commonmark.org/user_avatar/talk.commonmark.org/zzzzbov/32/218_2.png) [@zzzzBov](https://talk.commonmark.org/u/zzzzBov)\
**Post date:** [August 20, 2016, 2:51am UTC](https://talk.commonmark.org/t/list-becomes-header/2202/6 "2016-08-20T02:51:39Z")

</div>

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

> ```plaintext
> - Foo
> ---
> 
> ```

is shown to produce

> ```auto
> <ul>
> <li>Foo</li>
> </ul>
> <hr />
> 
> ```

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

---

<div class="post-metadata">

**Author:** ![Mike\_Ward](https://talk.commonmark.org/user_avatar/talk.commonmark.org/mike_ward/32/520_2.png) [@Mike\_Ward](https://talk.commonmark.org/u/Mike_Ward)\
**Post date:** [August 20, 2016, 4:01am UTC](https://talk.commonmark.org/t/list-becomes-header/2202/7 "2016-08-20T04:01:39Z")

</div>

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.
