From cd231ce81f6dd7a84cfb843e9535ee260f1c30f9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 24 Oct 2014 19:42:53 -0700 Subject: Spec: Added rule clarifying setext header content. Also several test cases. Closes #13. --- spec.txt | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) (limited to 'spec.txt') 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) 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) 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:

====

. +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: + +. +--- +--- +. +
+
+. + +. +- foo +----- +. + +
+. + +. + foo +--- +. +
foo
+
+
+. + +. +> foo +----- +. +
+

foo

+
+
+. + +If you want a header with `> foo` as its literal text, you can +use backslash escapes: + +. +\> foo +------ +. +

> foo

+. ## Indented code blocks -- cgit v1.2.3