Skip to content

Commit

Permalink
Editorial: hgroup makes multi-level heading in outline
Browse files Browse the repository at this point in the history
This change clarifies the fact that the outline algorithm requires
implementations to make any hgroup element in the source result in a
multi-level heading in the generated outline.
  • Loading branch information
sideshowbarker authored and domenic committed Aug 12, 2016
1 parent 1d196b3 commit bd6758b
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 15 deletions.
22 changes: 22 additions & 0 deletions images/outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 38 additions & 15 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -15891,40 +15891,55 @@ Space is not the only void</pre>
<p>The following markup fragment:</p>

<pre>&lt;body>
&lt;h1>A&lt;/h1>
&lt;p>B&lt;/p>
&lt;h2>C&lt;/h2>
&lt;p>D&lt;/p>
&lt;h2>E&lt;/h2>
&lt;p>F&lt;/p>
&lt;hgroup id="document-title">
&lt;h1>HTML&lt;/h1>
&lt;h2>Living Standard — Last Updated 12 August 2016&lt;/h2>
&lt;/hgroup>
&lt;p>Some intro to the document.&lt;/p>
&lt;h2>Table of contents&lt;/h2>
&lt;ol id=toc>...&lt;/ol>
&lt;h2>First section&lt;/h2>
&lt;p>Some intro to the first section.&lt;/p>
&lt;/body></pre>

<p>...results in the following outline being created for the <code>body</code> node (and thus the
entire document):</p>

<ol class="brief">
<li>
<p>Section created for <code>body</code> node.</p>
<p>Associated with heading "A".</p>
<p>Also associated with paragraph "B".</p>
<p><strong>Section created for <code>body</code> node</strong>.</p>
<p>Associated with heading <code data-x="">&lt;hgroup
id="document-title">...&lt;/hgroup></code> consisting of primary heading <code
data-x="">&lt;h1>HTML&lt;/h1></code> and secondary heading <code data-x="">&lt;h2>Living
Standard — Last Updated 12 August 2016&lt;/h2></code>.</p>
<p>Also associated with the paragraph <code data-x="">&lt;p>Some intro to the
document.&lt;/p></code> (though it likely would not be shown in a rendered view of the
outline).</p>
<p>Nested sections:</p>
<ol class="brief">
<li>
<p>Section implied for first <code>h2</code> element.</p>
<p>Associated with heading "C".</p>
<p>Also associated with paragraph "D".</p>
<p><strong>Section implied for first <code>h2</code> element.</strong></p>
<p>Associated with heading <code data-x="">&lt;h2>Table of contents&lt;/h2></code>.</p>
<p>Also associated with the ordered list <code data-x="">&lt;ol id=toc>...&lt;/ol></code>
(though it likely would not be shown in a rendered view of the outline).</p>
<p>No nested sections.</p>
</li>
<li>
<p>Section implied for second <code>h2</code> element.</p>
<p>Associated with heading "E".</p>
<p>Also associated with paragraph "F".</p>
<p><strong>Section implied for second <code>h2</code> element.</strong></p>
<p>Associated with heading <code data-x="">&lt;h2>First section>&lt;/h2></code>.</p>
<p>Also associated with the paragraph <code data-x="">&lt;p>Some intro to the first
section.&lt;/p></code> (though it likely would not be shown in a rendered view of the
outline).</p>
<p>No nested sections.</p>
</li>
</ol>
</li>
</ol>

<p>The following image shows what a rendered view of the outline might look like.</p>

<p><img src="/images/outline.svg" width="465" height="120"
alt="Outline showing rendering of a multi-level heading and other headings."></p>
</div>

<div w-nodev>
Expand Down Expand Up @@ -16124,6 +16139,14 @@ Space is not the only void</pre>
<p>If the <var>current section</var> has no heading, let the element being entered be
the heading for the <var>current section</var>.</p>

<p class="note">If the element being entered is an <code>hgroup</code> element, that
<code>hgroup</code> as a whole is a <em>multi-level</em> heading for the <var>current
section</var>, with the highest-<span data-x="rank">ranked</span>
<code>h1</code>&ndash;<code>h6</code> descendant of the <code>hgroup</code> providing the
primary heading for the <var>current section</var>, and with other
<code>h1</code>&ndash;<code>h6</code> descendants of the <code>hgroup</code> providing
secondary headings for the <var>current section</var>.</p>

<p>Otherwise, if the element being entered has a <span>rank</span> equal to or higher than the
heading of the last section of the <span>outline</span> of the <var>current outline
target</var>, or if the heading of the last section of the <span>outline</span> of the <var>current outline target</var> is an implied heading, then create a new <span
Expand Down

0 comments on commit bd6758b

Please sign in to comment.