From c0c2ae0bf1e88ec807ad9868c8a3f07388a25511 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Wed, 3 Sep 2014 23:29:48 -0500 Subject: perl wants "use utf8" when UTF-8 is in the source When there are literal UTF-8 characters in the source, "use utf8" will tell Perl to set the utf8 flag on strings. --- runtests.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/runtests.pl b/runtests.pl index 5facbe6..ce72931 100644 --- a/runtests.pl +++ b/runtests.pl @@ -1,6 +1,7 @@ #!/usr/bin/env perl use warnings; use strict; +use utf8; use Term::ANSIColor; use IO::Handle; use IPC::Open2; -- cgit v1.2.3 From d67a01b8619e59785ac3825c46c2ce8ce2e31b11 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Wed, 3 Sep 2014 23:31:55 -0500 Subject: require at least Perl 5.6 The core modules and pragmas being used require at least Perl 5.6 in order to work. Explicitly saying "use 5.006" will make the error more clear. --- runtests.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/runtests.pl b/runtests.pl index ce72931..7bffe81 100644 --- a/runtests.pl +++ b/runtests.pl @@ -1,4 +1,5 @@ #!/usr/bin/env perl +use 5.006; use warnings; use strict; use utf8; -- cgit v1.2.3 From 23fee89e91244d720c5321ab3ab2ad0293ae5014 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Wed, 3 Sep 2014 23:33:29 -0500 Subject: do not buffer STDOUT This ensures that the status line printed to STDERR at the very end of the script will appear after all other script output. --- runtests.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/runtests.pl b/runtests.pl index 7bffe81..370b43c 100644 --- a/runtests.pl +++ b/runtests.pl @@ -6,6 +6,7 @@ use utf8; use Term::ANSIColor; use IO::Handle; use IPC::Open2; +$|++; my $usage="runtests.pl PROGRAM SPEC\nSet ANSI_COLORS_DISABLED=1 if you redirect to a file.\nSet PATT='...' to restrict tests to sections matching a regex.\n"; -- cgit v1.2.3 From 53058ed98a3bb1340be23e907960524fd26c4c73 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Wed, 3 Sep 2014 23:35:36 -0500 Subject: also ignore vim swapfiles --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9cfb3a6..8af9a0d 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ *~ *.bak +*.swp *.diff *# scanners.c -- cgit v1.2.3 From 883f117643e91d213451f5aebde765e67d2706aa Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Wed, 3 Sep 2014 23:47:28 -0500 Subject: runtests.pl: switch the order of arguments Putting the spec file first lets us consume all the other arguments as the program to run. This makes it easier to use complex commands to run the tests. --- runtests.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/runtests.pl b/runtests.pl index 5facbe6..2e2b795 100644 --- a/runtests.pl +++ b/runtests.pl @@ -5,13 +5,13 @@ use Term::ANSIColor; use IO::Handle; use IPC::Open2; -my $usage="runtests.pl PROGRAM SPEC\nSet ANSI_COLORS_DISABLED=1 if you redirect to a file.\nSet PATT='...' to restrict tests to sections matching a regex.\n"; +my $usage="runtests.pl SPEC PROGRAM\nSet ANSI_COLORS_DISABLED=1 if you redirect to a file.\nSet PATT='...' to restrict tests to sections matching a regex.\n"; -my $PROG=$ARGV[0]; -my $SPEC=$ARGV[1]; +my $SPEC = shift @ARGV; +my @PROG = @ARGV; my $PATT=$ENV{'PATT'}; -if (!(defined $PROG && defined $SPEC)) { +if (!(@PROG && defined $SPEC)) { print STDERR $usage; exit 1; } @@ -69,7 +69,7 @@ sub dotest # We use → to indicate tab and ␣ space in the spec $markdown =~ s/→/\t/g;s/␣/ /g; $html =~ s/→/\t/g;s/␣/ /g; - open2(my $out, my $in, $PROG); + open2(my $out, my $in, @PROG); print $in $markdown; close $in; flush $out; -- cgit v1.2.3 From 364f9440ccc3bf54ae1db3455fbb9b6a6e9e1b2c Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Thu, 4 Sep 2014 00:12:05 -0500 Subject: only use colors when attached to a terminal If STDOUT is not hooked up to a terminal, automatically disable the colors by setting the appropriate environment variable. --- runtests.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtests.pl b/runtests.pl index 5facbe6..adcc373 100644 --- a/runtests.pl +++ b/runtests.pl @@ -16,6 +16,9 @@ if (!(defined $PROG && defined $SPEC)) { exit 1; } +# Disable ANSI colors if we're not hooked up to a terminal +$ENV{ANSI_COLORS_DISABLED} ||= !-t *STDOUT; + my $passed = 0; my $failed = 0; my $skipped = 0; -- cgit v1.2.3 From 109beaca36bf2ab5af6ab8eab47075d803eb4430 Mon Sep 17 00:00:00 2001 From: Anders Persson Date: Thu, 4 Sep 2014 09:01:07 +0200 Subject: Fix typo --- spec.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.txt b/spec.txt index fbdf0cf..132e0be 100644 --- a/spec.txt +++ b/spec.txt @@ -5116,7 +5116,7 @@ than emphasis:

*foo*

. -However, this is not, because link labels bind tight less +However, this is not, because link labels bind less tightly than code backticks: . -- cgit v1.2.3 From 8c13424a9fc8e44fa66f501dc6373eed2f355c2d Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Thu, 4 Sep 2014 09:40:05 +0200 Subject: Fixed some typos in spec.txt --- spec.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec.txt b/spec.txt index fbdf0cf..1c85649 100644 --- a/spec.txt +++ b/spec.txt @@ -5952,7 +5952,7 @@ references constructed in phase 1. At each point in processing, the document is represented as a tree of **blocks**. The root of the tree is a `document` block. The `document` may have any number of other blocks as **children**. These children -may, in turn, have other blocks a children. The last child of a block +may, in turn, have other blocks as children. The last child of a block is normally considered **open**, meaning that subsequent lines of input can alter its contents. (Blocks that are not open are **closed**.) Here, for example, is a possible document tree, with the open blocks @@ -6045,8 +6045,8 @@ The third line, causes the `paragraph` block to be closed, and a new `list` block opened as a child of the `block_quote`. A `list_item` is also -added as a child of the `list`, and a `paragraph` as a chid of -the `list_item`. The text is then added to the `paragraph`: +added as a child of the `list`, and a `paragraph` as a child of +the `list_item`. The text is then added to the new `paragraph`: ``` tree -> document -- cgit v1.2.3 From 799da32081fffdd896496bd9149c9fe612c410a2 Mon Sep 17 00:00:00 2001 From: asgh Date: Thu, 4 Sep 2014 03:57:17 -0400 Subject: Don't leave empty file if re2c is missing Fixes Issue #35 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ee3c204..8ded96b 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ $(PROG): $(SRCDIR)/main.c $(SRCDIR)/inlines.o $(SRCDIR)/blocks.o $(SRCDIR)/detab $(CC) $(LDFLAGS) -o $@ $^ $(SRCDIR)/scanners.c: $(SRCDIR)/scanners.re - re2c --case-insensitive -bis $< > $@ + re2c --case-insensitive -bis $< > $@ || rm $@ $(SRCDIR)/case_fold_switch.c: $(DATADIR)/CaseFolding-3.2.0.txt perl mkcasefold.pl < $< > $@ -- cgit v1.2.3 From e738455531f62c5eb40c91838a129d3249b93b86 Mon Sep 17 00:00:00 2001 From: asgh Date: Thu, 4 Sep 2014 04:32:26 -0400 Subject: Better error --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8ded96b..c0cf96b 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ $(PROG): $(SRCDIR)/main.c $(SRCDIR)/inlines.o $(SRCDIR)/blocks.o $(SRCDIR)/detab $(CC) $(LDFLAGS) -o $@ $^ $(SRCDIR)/scanners.c: $(SRCDIR)/scanners.re - re2c --case-insensitive -bis $< > $@ || rm $@ + re2c --case-insensitive -bis $< > $@ || (rm $@ && false) $(SRCDIR)/case_fold_switch.c: $(DATADIR)/CaseFolding-3.2.0.txt perl mkcasefold.pl < $< > $@ -- cgit v1.2.3 From 9e05730f36be7a1707751ef0aeeb5d6695007667 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 4 Sep 2014 09:38:21 -0700 Subject: Updated Makefile for #29. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c0cf96b..c1decfc 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ oldtests: make -C oldtests --quiet clean all test: spec.txt - perl runtests.pl $(PROG) $< + perl runtests.pl $< $(PROG) testjs: spec.txt node js/test.js -- cgit v1.2.3 From d9152ff0f26162de7c29896cd4d1d061b5ed0c80 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 4 Sep 2014 09:49:14 -0700 Subject: Fixed link. --- spec.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.txt b/spec.txt index ad3e9da..cbe58a4 100644 --- a/spec.txt +++ b/spec.txt @@ -2889,7 +2889,7 @@ continued here.

5. **That's all.** Nothing that is not counted as a list item by rules - #1--4 counts as a [list item](#block-quote). + #1--4 counts as a [list item](#list-item). The rules for sublists follow from the general rules above. A sublist must be indented the same number of spaces a paragraph would need to be -- cgit v1.2.3 From 3e7594489336d43092e328db06ef0e239c9ddfda Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 4 Sep 2014 09:52:50 -0700 Subject: Revert "only use colors when attached to a terminal" --- runtests.pl | 3 --- 1 file changed, 3 deletions(-) diff --git a/runtests.pl b/runtests.pl index 2d80f14..2e2b795 100644 --- a/runtests.pl +++ b/runtests.pl @@ -16,9 +16,6 @@ if (!(@PROG && defined $SPEC)) { exit 1; } -# Disable ANSI colors if we're not hooked up to a terminal -$ENV{ANSI_COLORS_DISABLED} ||= !-t *STDOUT; - my $passed = 0; my $failed = 0; my $skipped = 0; -- cgit v1.2.3 From 5b639ace36130bd722413b66833478126d27ccca Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 4 Sep 2014 09:59:17 -0700 Subject: Revert "Perl changes" --- .gitignore | 1 - runtests.pl | 3 --- 2 files changed, 4 deletions(-) diff --git a/.gitignore b/.gitignore index 8af9a0d..9cfb3a6 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,6 @@ *~ *.bak -*.swp *.diff *# scanners.c diff --git a/runtests.pl b/runtests.pl index 1dfdcf6..2e2b795 100644 --- a/runtests.pl +++ b/runtests.pl @@ -1,12 +1,9 @@ #!/usr/bin/env perl -use 5.006; use warnings; use strict; -use utf8; use Term::ANSIColor; use IO::Handle; use IPC::Open2; -$|++; my $usage="runtests.pl SPEC PROGRAM\nSet ANSI_COLORS_DISABLED=1 if you redirect to a file.\nSet PATT='...' to restrict tests to sections matching a regex.\n"; -- cgit v1.2.3 From c40676bd9fd2604de6c35a97a219aa3c56d7ec32 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 4 Sep 2014 10:13:04 -0700 Subject: spec: Use closing tags on a elements. Closes #46, closes #40. --- spec.txt | 138 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/spec.txt b/spec.txt index cbe58a4..f19413c 100644 --- a/spec.txt +++ b/spec.txt @@ -191,7 +191,7 @@ In the examples, the `→` character is used to represent tabs. # Preprocessing -A [line](#line) +A [line](#line) is a sequence of zero or more characters followed by a line ending (CR, LF, or CRLF) or by the end of file. @@ -217,15 +217,15 @@ foo→baz→→bim Line endings are replaced by newline characters (LF). A line containing only spaces (after tab expansion) followed by -a line ending is called a [blank line](#blank-line). +a line ending is called a [blank line](#blank-line). + # Blocks and inlines We can think of a document as a sequence of [blocks](#block)---structural elements like paragraphs, block quotations, +id="block">---structural elements like paragraphs, block quotations, lists, headers, rules, and code blocks. Blocks can contain other -blocks, or they can contain [inline](#inline) content: +blocks, or they can contain [inline](#inline) content: words, spaces, links, emphasized text, images, and inline code. ## Precedence @@ -256,9 +256,9 @@ one block element does not affect the inline parsing of any other. ## Container blocks and leaf blocks We can divide blocks into two types: -[container blocks](#container-block), +[container blocks](#container-block), which can contain other blocks, and [leaf blocks](#leaf-block), - which cannot. + which cannot. # Leaf blocks @@ -270,7 +270,7 @@ Markdown document. A line consisting of 0-3 spaces of indentation, followed by a sequence of three or more matching `-`, `_`, or `*` characters, each followed optionally any number of spaces, forms a [horizontal -rule](#horizontal-rule). +rule](#horizontal-rule). . *** @@ -465,7 +465,7 @@ If you want a horizontal rule in a list item, use a different bullet: ## ATX headers -An [ATX header](#atx-header) +An [ATX header](#atx-header) 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 `#` characters. The opening sequence @@ -655,11 +655,11 @@ ATX headers can be empty: ## Setext headers -A [setext header](#setext-header) +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) +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 spaces. The header is a level 1 header if `=` characters are used, and @@ -863,9 +863,9 @@ Setext headers cannot be empty: ## Indented code blocks An [indented code block](#indented-code-block) - is composed of one or more + is composed of one or more [indented chunks](#indented-chunk) separated by blank lines. -An [indented chunk](#indented-chunk) +An [indented chunk](#indented-chunk) is a sequence of non-blank lines, each indented four or more spaces. An indented code block cannot interrupt a paragraph, so if it occurs before or after a paragraph, there must be an @@ -1015,16 +1015,16 @@ Trailing spaces are included in the code block's content: ## Fenced code blocks -A [code fence](#code-fence) is a sequence +A [code fence](#code-fence) is a sequence of at least three consecutive backtick characters (`` ` ``) or tildes (`~`). (Tildes and backticks cannot be mixed.) -A [fenced code block](#fenced-code-block) +A [fenced code block](#fenced-code-block) begins with a code fence, indented no more than three spaces. The line with the opening code fence may optionally contain some text following the code fence; this is trimmed of leading and trailing -spaces and called the [info string](#info-string). The info string may not contain any backtick +spaces and called the [info string](#info-string). + The info string may not contain any backtick characters. (The reason for this restriction is that otherwise some inline code would be incorrectly interpreted as the beginning of a fenced code block.) @@ -1343,7 +1343,7 @@ Closing code fences cannot have info strings: ## HTML blocks -An [HTML block tag](#html-block-tag) is +An [HTML block tag](#html-block-tag) is an [open tag](#open-tag) or [closing tag](#closing-tag) whose tag name is one of the following (case-insensitive): `article`, `header`, `aside`, `hgroup`, `blockquote`, `hr`, `body`, @@ -1354,7 +1354,7 @@ name is one of the following (case-insensitive): `footer`, `tr`, `form`, `ul`, `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `video`, `script`, `style`. -An [HTML block](#html-block) begins with an +An [HTML block](#html-block) begins with an [HTML block tag](#html-block-tag), [HTML comment](#html-comment), [processing instruction](#processing-instruction), [declaration](#declaration), or [CDATA section](#cdata-section). @@ -1629,7 +1629,7 @@ So there is no important loss of expressive power with the new rule. ## Link reference definitions A [link reference definition](#link-reference-definition) - consists of a [link + consists of a [link label](#link-label), indented up to three spaces, followed by a colon (`:`), optional blank space (including up to one newline), a [link destination](#link-destination), optional @@ -1854,7 +1854,7 @@ are defined: ## Paragraphs A sequence of non-blank lines that cannot be interpreted as other -kinds of blocks forms a [paragraph](#paragraph) . +kinds of blocks forms a [paragraph](#paragraph) . The contents of the paragraph are the result of parsing the paragraph's raw content as inlines. The paragraph's raw content is formed by concatenating the lines and removing initial and final @@ -1998,12 +1998,12 @@ provided below in the section entitled [A parsing strategy].) ## Block quotes -A [block quote marker](#block-quote-marker) +A [block quote marker](#block-quote-marker) consists of 0-3 spaces of initial indent, plus (a) the character `>` together with a following space, or (b) a single character `>` not followed by a space. The following rules define [block quotes](#block-quote): - + 1. **Basic case.** If a string of lines *Ls* constitute a sequence of blocks *Bs*, then the result of appending a [block quote marker] @@ -2016,7 +2016,7 @@ The following rules define [block quotes](#block-quote): more lines in which the next non-space character after the [block quote marker](#block-quote-marker) is [paragraph continuation text](#paragraph-continuation-text) is a block quote with *Bs* as - its content. + its content. [Paragraph continuation text](#paragraph-continuation-text) is text that will be parsed as part of the content of a paragraph, but does not occur at the beginning of the paragraph. @@ -2360,14 +2360,14 @@ the `>`: ## List items -A [list marker](#list-marker) is a +A [list marker](#list-marker) is a [bullet list marker](#bullet-list-marker) or an [ordered list marker](#ordered-list-marker). -A [bullet list marker](#bullet-list-marker) +A [bullet list marker](#bullet-list-marker) is a `-`, `+`, or `*` character. -An [ordered list marker](#ordered-list-marker) +An [ordered list marker](#ordered-list-marker) is a sequence of one of more digits (`0-9`), followed by either a `.` character or a `)` character. @@ -3183,25 +3183,25 @@ takes four spaces (a common case), but diverge in other cases. ## Lists -A [list](#list) is a sequence of one or more +A [list](#list) is a sequence of one or more list items [of the same type](#of-the-same-type). The list items may be separated by single [blank lines](#blank-line), but two blank lines end all containing lists. Two list items are [of the same type](#of-the-same-type) - if they begin with a [list + if they begin with a [list marker](#list-marker) of the same type. Two list markers are of the same type if (a) they are bullet list markers using the same character (`-`, `+`, or `*`) or (b) they are ordered list numbers with the same delimiter (either `.` or `)`). -A list is an [ordered list](#ordered-list) +A list is an [ordered list](#ordered-list) if its constituent list items begin with [ordered list markers](#ordered-list-marker), and a [bullet -list](#bullet-list) if its constituent list +list](#bullet-list) if its constituent list items begin with [bullet list markers](#bullet-list-marker). -The [start number](#start-number) +The [start number](#start-number) of an [ordered list](#ordered-list) is determined by the list number of its initial list item. The numbers of subsequent list items are disregarded. @@ -3726,7 +3726,7 @@ foo Entities are parsed as entities, not as literal text, in all contexts except code spans and code blocks. Three kinds of entities are recognized. -[Named entities](#name-entities) consist of `&` +[Named entities](#name-entities) consist of `&` + a string of 2-32 alphanumerics beginning with a letter + `;`. . @@ -3735,7 +3735,7 @@ except code spans and code blocks. Three kinds of entities are recognized.

  & © Æ Ď ¾ ℋ ⅆ ∲

. -[Decimal entities](#decimal-entities) +[Decimal entities](#decimal-entities) consist of `&#` + a string of 1--8 arabic digits + `;`. . @@ -3744,7 +3744,7 @@ consist of `&#` + a string of 1--8 arabic digits + `;`.

 # Ӓ Ϡ �

. -[Hexadecimal entities](#hexadecimal-entities) +[Hexadecimal entities](#hexadecimal-entities) consist of `&#` + either `X` or `x` + a string of 1-8 hexadecimal digits + `;`. @@ -3830,7 +3830,7 @@ Entities are treated as literal text in code spans and code blocks: ## Code span -A [backtick string](#backtick-string) +A [backtick string](#backtick-string) is a string of one or more backtick characters (`` ` ``) that is neither preceded nor followed by a backtick. @@ -4015,7 +4015,7 @@ The following rules capture all of these patterns, while allowing for efficient parsing strategies that do not backtrack: 1. A single `*` character [can open emphasis](#can-open-emphasis) - iff + iff (a) it is not part of a sequence of four or more unescaped `*`s, (b) it is not followed by whitespace, and @@ -4031,7 +4031,7 @@ for efficient parsing strategies that do not backtrack: followed immediately by strong emphasis. 3. A single `*` character [can close emphasis](#can-close-emphasis) - iff + iff (a) it is not part of a sequence of four or more unescaped `*`s, and (b) it is not preceded by whitespace. @@ -4043,7 +4043,7 @@ for efficient parsing strategies that do not backtrack: (c) it is not followed by an ASCII alphanumeric character. 5. A double `**` [can open strong emphasis](#can-open-strong-emphasis) - iff + iff (a) it is not part of a sequence of four or more unescaped `*`s, (b) it is not followed by whitespace, and @@ -4060,7 +4060,7 @@ for efficient parsing strategies that do not backtrack: followed immediately by emphasis. 7. A double `**` [can close strong emphasis](#can-close-strong-emphasis) - iff + iff (a) it is not part of a sequence of four or more unescaped `*`s, and (b) it is not preceded by whitespace. @@ -4642,7 +4642,7 @@ and title are given immediately after the label. In [reference links](#reference-links) the destination and title are defined elsewhere in the document. -A [link label](#link-label) consists of +A [link label](#link-label) consists of - an opening `[`, followed by - zero or more backtick code spans, autolinks, HTML tags, link labels, @@ -4657,7 +4657,7 @@ These rules are motivated by the following intuitive ideas: but less tightly than `<>` or `` ` ``. - Link labels may contain material in matching square brackets. -A [link destination](#link-destination) +A [link destination](#link-destination) consists of either - a sequence of zero or more characters between an opening `<` and a @@ -4670,7 +4670,7 @@ consists of either a balanced pair of unescaped parentheses that is not itself inside a balanced pair of unescaped paretheses. -A [link title](#link-title) consists of either +A [link title](#link-title) consists of either - a sequence of zero or more characters between straight double-quote characters (`"`), including a `"` character only if it is @@ -4683,7 +4683,7 @@ A [link title](#link-title) consists of either - a sequence of zero or more characters between matching parentheses (`(...)`), including a `)` character only if it is backslash-escaped. -An [inline link](#inline-link) +An [inline link](#inline-link) consists of a [link label](#link-label) followed immediately by a left parenthesis `(`, optional whitespace, an optional [link destination](#link-destination), @@ -4887,15 +4887,15 @@ an HTML tag: There are three kinds of [reference links](#reference-link): - + -A [full reference link](#full-reference-link) +A [full reference link](#full-reference-link) consists of a [link label](#link-label), optional whitespace, and another [link label](#link-label) that [matches](#matches) a [link reference definition](#link-reference-definition) elsewhere in the document. -One label [matches](#matches) +One label [matches](#matches) another just in case their normalized forms are equal. To normalize a label, perform the *unicode case fold* and collapse consecutive internal whitespace to a single space. If there are multiple matching reference @@ -5003,7 +5003,7 @@ labels define equivalent inline content: . A [collapsed reference link](#collapsed-reference-link) - consists of a [link + consists of a [link label](#link-label) that [matches](#matches) a [link reference definition](#link-reference-definition) elsewhere in the document, optional whitespace, and the string `[]`. The contents of the @@ -5051,7 +5051,7 @@ between the two sets of brackets: . A [shortcut reference link](#shortcut-reference-link) - consists of a [link + consists of a [link label](#link-label) that [matches](#matches) a [link reference definition](#link-reference-definition) elsewhere in the document and is not followed by `[]` or a link label. @@ -5386,18 +5386,18 @@ Autolinks are absolute URIs and email addresses inside `<` and `>`. They are parsed as links, with the URL or email address as the link label. -A [URI autolink](#uri-autolink) +A [URI autolink](#uri-autolink) consists of `<`, followed by an [absolute URI](#absolute-uri) not containing `<`, followed by `>`. It is parsed as a link to the URI, with the URI as the link's label. -An [absolute URI](#absolute-uri), +An [absolute URI](#absolute-uri), for these purposes, consists of a [scheme](#scheme) followed by a colon (`:`) followed by zero or more characters other than ASCII whitespace and control characters, `<`, and `>`. If the URI includes these characters, you must use percent-encoding (e.g. `%20` for a space). -The following [schemes](#scheme) +The following [schemes](#scheme) are recognized (case-insensitive): `coap`, `doi`, `javascript`, `aaa`, `aaas`, `about`, `acap`, `cap`, `cid`, `crid`, `data`, `dav`, `dict`, `dns`, `file`, `ftp`, `geo`, `go`, @@ -5459,12 +5459,12 @@ Spaces are not allowed in autolinks:

<http://foo.bar/baz bim>

. -An [email autolink](#email-autolink) +An [email autolink](#email-autolink) consists of `<`, followed by an [email address](#email-address), followed by `>`. The link's label is the email address, and the URL is `mailto:` followed by the email address. -An [email address](#email-address), +An [email address](#email-address), for these purposes, is anything that matches the [non-normative regex from the HTML5 spec](http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#e-mail-state-%28type=email%29): @@ -5539,67 +5539,67 @@ so custom tags (and even, say, DocBook tags) may be used. Here is the grammar for tags: -A [tag name](#tag-name) consists of an ASCII letter +A [tag name](#tag-name) consists of an ASCII letter followed by zero or more ASCII letters or digits. -An [attribute](#attribute) consists of whitespace, +An [attribute](#attribute) consists of whitespace, an **attribute name**, and an optional **attribute value specification**. -An [attribute name](#attribute-name) +An [attribute name](#attribute-name) consists of an ASCII letter, `_`, or `:`, followed by zero or more ASCII letters, digits, `_`, `.`, `:`, or `-`. (Note: This is the XML specification restricted to ASCII. HTML5 is laxer.) An [attribute value specification](#attribute-value-specification) - consists of optional whitespace, + consists of optional whitespace, a `=` character, optional whitespace, and an [attribute value](#attribute-value). -An [attribute value](#attribute-value) +An [attribute value](#attribute-value) consists of an [unquoted attribute value](#unquoted-attribute-value), a [single-quoted attribute value](#single-quoted-attribute-value), or a [double-quoted attribute value](#double-quoted-attribute-value). An [unquoted attribute value](#unquoted-attribute-value) - is a nonempty string of characters not + is a nonempty string of characters not including spaces, `"`, `'`, `=`, `<`, `>`, or `` ` ``. A [single-quoted attribute value](#single-quoted-attribute-value) - consists of `'`, zero or more + consists of `'`, zero or more characters not including `'`, and a final `'`. A [double-quoted attribute value](#double-quoted-attribute-value) - consists of `"`, zero or more + consists of `"`, zero or more characters not including `"`, and a final `"`. -An [open tag](#open-tag) consists of a `<` character, +An [open tag](#open-tag) consists of a `<` character, a [tag name](#tag-name), zero or more [attributes](#attribute), optional whitespace, an optional `/` character, and a `>` character. -A [closing tag](#closing-tag) consists of the +A [closing tag](#closing-tag) consists of the string ``. -An [HTML comment](#html-comment) consists of the +An [HTML comment](#html-comment) consists of the string ``. A [processing instruction](#processing-instruction) - consists of the string ` consists of the string ``, and the string `?>`. -A [declaration](#declaration) consists of the +A [declaration](#declaration) consists of the string ``, and the character `>`. -A [CDATA section](#cdata-section) consists of +A [CDATA section](#cdata-section) consists of the string ``, and the string `]]>`. -An [HTML tag](#html-tag) consists of an [open +An [HTML tag](#html-tag) consists of an [open tag](#open-tag), a [closing tag](#closing-tag), an [HTML comment](#html-comment), a [processing instruction](#processing-instruction), an [element type -- cgit v1.2.3 From 0a0cdcf1df12ef6a0dcdaf5d37894438aae50bc4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 4 Sep 2014 10:31:34 -0700 Subject: Fixed typo. Closes #44. Thanks, @fordhurley. --- spec.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.txt b/spec.txt index f19413c..e3f0cd8 100644 --- a/spec.txt +++ b/spec.txt @@ -269,7 +269,7 @@ Markdown document. A line consisting of 0-3 spaces of indentation, followed by a sequence of three or more matching `-`, `_`, or `*` characters, each followed -optionally any number of spaces, forms a [horizontal +optionally by any number of spaces, forms a [horizontal rule](#horizontal-rule). . -- cgit v1.2.3