summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-10-24 19:42:53 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-10-24 19:42:53 -0700
commitcd231ce81f6dd7a84cfb843e9535ee260f1c30f9 (patch)
tree40653abfe1a1efb798b7d76272ba95b200b96c93
parentedbb60856f5854ecfdc75d82f845117b43c2655c (diff)
Spec: Added rule clarifying setext header content.
Also several test cases. Closes #13.
-rw-r--r--spec.txt55
1 files changed, 54 insertions, 1 deletions
diff --git a/spec.txt b/spec.txt
index 54d49cd..4d2a987 100644
--- a/spec.txt
+++ b/spec.txt
@@ -662,7 +662,10 @@ ATX headers can be empty:
A [setext header](#setext-header) <a id="setext-header"></a>
consists of a line of text, containing at least one nonspace character,
with no more than 3 spaces indentation, followed by a [setext header
-underline](#setext-header-underline). A [setext header
+underline](#setext-header-underline). The line of text must be
+one that, were it not followed by the setext header underline,
+would be interpreted as part of a paragraph: it cannot be a code
+block, header, blockquote, horizontal rule, or list. A [setext header
underline](#setext-header-underline) <a id="setext-header-underline"></a>
is a sequence of `=` characters or a sequence of `-` characters, with no
more than 3 spaces indentation and any number of trailing
@@ -863,6 +866,56 @@ Setext headers cannot be empty:
<p>====</p>
.
+Setext header text lines must not be interpretable as block
+constructs other than paragraphs. So, the line of dashes
+in these examples gets interpreted as a horizontal rule:
+
+.
+---
+---
+.
+<hr />
+<hr />
+.
+
+.
+- foo
+-----
+.
+<ul>
+<li>foo</li>
+</ul>
+<hr />
+.
+
+.
+ foo
+---
+.
+<pre><code>foo
+</code></pre>
+<hr />
+.
+
+.
+> foo
+-----
+.
+<blockquote>
+<p>foo</p>
+</blockquote>
+<hr />
+.
+
+If you want a header with `> foo` as its literal text, you can
+use backslash escapes:
+
+.
+\> foo
+------
+.
+<h2>&gt; foo</h2>
+.
## Indented code blocks