# Which is correct: spec or example?

**URL:** <https://talk.commonmark.org/t/which-is-correct-spec-or-example/3868>\
**Category:** Spec\
**Created:** [May 8, 2021, 11:57pm UTC](https://talk.commonmark.org/t/which-is-correct-spec-or-example/3868 "2021-05-08T23:57:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackdw](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/j/51bf81/32.png) [@jackdw](https://talk.commonmark.org/u/jackdw)\
**Post date:** [May 8, 2021, 11:57pm UTC](https://talk.commonmark.org/t/which-is-correct-spec-or-example/3868/1 "2021-05-08T23:57:34Z")

</div>

Hey all, been a while. Doing the crossing the i and dotting the t thing on my linter’s beta release, and I came across these two seemingly contradictory things:

> 4.2. Atx Headings  
> An [ATX heading](https://github.github.com/gfm/#atx-heading) consists of a string of characters, parsed as inline content, between an opening sequence of 1–6 unescaped `#` characters and an optional closing sequence of any number of unescaped `#` characters. The opening sequence of `#` characters must be followed by a [space](https://github.github.com/gfm/#space) or by the end of line.

Verify specifically, it references a single space character, hex 20, and not whitespace. However, [example 10](https://github.github.com/gfm/#example-10):

```Markdown
#→Foo

```

is supposed to produce:

```HTML
<h1>Foo</h1>

```

Which makes it seem like it should be any whitespace character, not just a space character.

So which is correct? the specification or the example?

---

<div class="post-metadata">

**Author:** ![vas](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/vas/32/1267_2.png) [@vas](https://talk.commonmark.org/u/vas)\
**Post date:** [May 9, 2021, 11:32am UTC](https://talk.commonmark.org/t/which-is-correct-spec-or-example/3868/2 "2021-05-09T11:32:15Z")

</div>

Both.

> [However, in contexts where whitespace helps to define block structure, tabs behave as if they were replaced by spaces with a tab stop of 4 characters.](https://spec.commonmark.org/0.29/#tabs)

The example you point out is there precisely to make a point of this.

---

<div class="post-metadata">

**Author:** ![jackdw](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/j/51bf81/32.png) [@jackdw](https://talk.commonmark.org/u/jackdw)\
**Post date:** [May 9, 2021, 4:19pm UTC](https://talk.commonmark.org/t/which-is-correct-spec-or-example/3868/3 "2021-05-09T16:19:01Z")

</div>

So here is where I have a problem with that statement. When I am reading specifications, I generally look for overarching statements and specific statements. To me, what you quoted, was an overarching statement, while the quote I provided was a specific statement from that element. Because that statement is more specific, I give it more weight, and assume that I overrides a more overarching statement.

Given that mindset, when I read that statement and an explicit reference to a SPACE character([GitHub Flavored Markdown Spec](https://github.github.com/gfm/#space)) when it would have been as easy to reference a WHITESPACE character ([GitHub Flavored Markdown Spec](https://github.github.com/gfm/#whitespace-character)) or a UNICODE WHITESPACE character ([GitHub Flavored Markdown Spec](https://github.github.com/gfm/#unicode-whitespace-character)), makes me believe that was specifically put there for a reason.

Does that reading, and hence my confusion, make sense?

---

<div class="post-metadata">

**Author:** ![jgm](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/jgm/32/1360_2.png) [@jgm](https://talk.commonmark.org/u/jgm)\
**Post date:** [May 9, 2021, 8:41pm UTC](https://talk.commonmark.org/t/which-is-correct-spec-or-example/3868/4 "2021-05-09T20:41:57Z")

</div>

You’ll be happy to hear that the current dev version of the  
spec (not yet released) has different wording:

“The opening sequence of `#` characters must be followed by spaces or tabs, or  
by the end of line.”

This will be in the next release. (And then hopefully GitHub  
will also update their derived spec.)

---

<div class="post-metadata">

**Author:** ![zamfofex](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/zamfofex/32/2148_2.png) [@zamfofex](https://talk.commonmark.org/u/zamfofex)\
**Post date:** [June 5, 2021, 6:06pm UTC](https://talk.commonmark.org/t/which-is-correct-spec-or-example/3868/5 "2021-06-05T18:06:42Z")

</div>

Maybe it could be worthwhile to define some term to refer to expanded spaces collective, whether they come from tabs or a `U+0020` codepoint.

I don’t really know what would be the best way to do this, given that it seems the spec sometimes needs to talk about literal tabs and `\x20`, and sometimes also about their interaction with each other and with expanded spaces.
