HTML has a six level header system for document organization. The idea being that the <h1>
level should have the page name, with <h2>
subsections underneath. If further subsections are needed there are <h3>
, <h4>
, <h5>
, and <h6>
. So you could have some thing like
<h1>Page Name</h1>
<h2>Sub-section</h2>
<h3>Sub-sub-section</h3>
<h4>Sub-sub-sub-section</h4>
<h5>Sub-sub-sub-sub-section</h5>
<h6>Sub-sub-sub-sub-sub-section</h6>
<h3>Sub-sub-section 2</h3>
This provides a nice hierarchical organization. Stack Exchange sort of supports headers, but it’s entirely manual. And for some reason, two of the Markdown constructs create <h1>
and <h2>
headers, even in answers. So if people use the Markdown content as follows
Section 1
=========
Sub-section 1
-------------
Sub-section 2
-------------
If in the question body, we'd get
<h1>Question?</h1>
<h1>Section 1</h1>
<h2>Sub-section 1</h2>
<h2>Sub-section 2</h2>
<h2>COUNT Answers</h2>
and if in an answer, we'd see
<h1>Question?</h1>
<h2>COUNT Answers</h2>
<h1>Section 1</h1>
<h2>Sub-section 1</h2>
<h2>Sub-section 2</h2>
Eek! Either of those is wrong.
Note: I'm skipping a lot of content for brevity's sake. Presumably most people aren't composing their questions or answers entirely of headers. I'm leaving out the paragraphs, divs, etc.
So rather than have ===
and ---
make h1 and h2 headers, could they instead be h2 and h3 in question bodies and h3 and h4 in answers?
Similarly, can you do one of the following?
- Demote
#
,##
,###
, and####
to<h3>
,<h4>
,<h5>
, and<h6>
in answers? - Or demote
#
and##
to<h3>
in answers and leave the others as is?
Either should change questions as well, but #
would become <h2>
instead of <h3>
in questions.
The first better preserves the existing hierarchy while the second better preserves the intentions of people who currently use <h3>
headers to denote top level sections of answers. Either would tend to lead to a lot of Markdown content being slightly wrong, as one preserves semantics while the other preserves display.
Note: a side issue is that search engine optimization works best if there is only one h1 per page and it has the same content as the page <title>
.
Examples of problems that arise in the current system:
- On Stack Overflow: Is using 'heading' Markdown okay in answers?
- On Code Review: Discouraging gigantic headers in answers?
Note that both those problems would be fixed by this proposal. No one would use an <h1>
or <h2>
tag via Markdown in an answer anymore.