From 4fba8757fe61322b236b0adec7215b56e40d29c3 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Sat, 6 Oct 2018 10:31:35 +0200 Subject: [PATCH 1/7] remark-parse: add label to definition --- packages/remark-parse/lib/tokenize/definition.js | 1 + packages/remark-stringify/lib/visitors/definition.js | 2 +- test/fixtures/tree/amps-and-angles-encoding.json | 2 ++ test/fixtures/tree/case-insensitive-refs.json | 1 + test/fixtures/tree/def-blocks.json | 3 +++ test/fixtures/tree/definition-newline.commonmark.json | 2 ++ test/fixtures/tree/definition-newline.json | 3 +++ test/fixtures/tree/definition-unclosed.json | 1 + test/fixtures/tree/definition-url-entities.json | 1 + test/fixtures/tree/entities.output.entities.json | 3 +++ test/fixtures/tree/entities.output.entities=escape.json | 3 +++ test/fixtures/tree/entities.output.entities=numbers.json | 3 +++ test/fixtures/tree/entities.output.noentities.json | 3 +++ test/fixtures/tree/footnote-without-space.json | 1 + test/fixtures/tree/footnote.footnotes.json | 1 + test/fixtures/tree/footnote.json | 1 + test/fixtures/tree/links-reference-proto.json | 3 +++ test/fixtures/tree/links-reference-style.json | 7 +++++++ test/fixtures/tree/links-shortcut-references.json | 5 +++++ test/fixtures/tree/list-continuation.footnotes.json | 1 + .../tree/list-continuation.footnotes.pedantic.json | 1 + test/fixtures/tree/list-continuation.json | 1 + .../fixtures/tree/list-continuation.nogfm.footnotes.json | 1 + .../tree/list-continuation.nogfm.footnotes.pedantic.json | 1 + test/fixtures/tree/list-continuation.nogfm.json | 1 + test/fixtures/tree/list-continuation.nogfm.pedantic.json | 1 + test/fixtures/tree/list-continuation.pedantic.json | 1 + test/fixtures/tree/main.json | 1 + test/fixtures/tree/main.nogfm.json | 1 + test/fixtures/tree/main.nogfm.pedantic.json | 1 + test/fixtures/tree/main.pedantic.json | 1 + test/fixtures/tree/markdown-documentation-basics.json | 3 +++ .../tree/markdown-documentation-syntax.commonmark.json | 9 +++++++++ ...arkdown-documentation-syntax.commonmark.pedantic.json | 9 +++++++++ test/fixtures/tree/markdown-documentation-syntax.json | 9 +++++++++ .../markdown-documentation-syntax.nogfm.commonmark.json | 9 +++++++++ ...n-documentation-syntax.nogfm.commonmark.pedantic.json | 9 +++++++++ .../tree/markdown-documentation-syntax.nogfm.json | 9 +++++++++ .../markdown-documentation-syntax.nogfm.pedantic.json | 9 +++++++++ .../tree/markdown-documentation-syntax.pedantic.json | 9 +++++++++ .../tree/nested-references.commonmark.footnotes.json | 2 ++ test/fixtures/tree/nested-references.commonmark.json | 2 ++ test/fixtures/tree/nested-references.footnotes.json | 2 ++ test/fixtures/tree/nested-references.json | 2 ++ test/fixtures/tree/ref-paren.json | 1 + test/fixtures/tree/reference-image-empty-alt.json | 1 + test/fixtures/tree/reference-link-escape.nooutput.json | 1 + .../tree/reference-link-with-angle-brackets.json | 1 + .../tree/reference-link-with-multiple-definitions.json | 2 ++ test/fixtures/tree/toplevel-paragraphs.json | 1 + test/fixtures/tree/toplevel-paragraphs.nogfm.json | 1 + 51 files changed, 148 insertions(+), 1 deletion(-) diff --git a/packages/remark-parse/lib/tokenize/definition.js b/packages/remark-parse/lib/tokenize/definition.js index 1cce274cf..3f9e51a64 100644 --- a/packages/remark-parse/lib/tokenize/definition.js +++ b/packages/remark-parse/lib/tokenize/definition.js @@ -255,6 +255,7 @@ function definition(eat, value, silent) { return eat(subvalue)({ type: 'definition', identifier: normalize(identifier), + label: identifier, title: title || null, url: url }); diff --git a/packages/remark-stringify/lib/visitors/definition.js b/packages/remark-stringify/lib/visitors/definition.js index 0fc855560..d6abb2ab4 100644 --- a/packages/remark-stringify/lib/visitors/definition.js +++ b/packages/remark-stringify/lib/visitors/definition.js @@ -19,5 +19,5 @@ function definition(node) { content += ' ' + title(node.title); } - return '[' + node.identifier + ']: ' + content; + return '[' + (node.label || node.identifier) + ']: ' + content; } diff --git a/test/fixtures/tree/amps-and-angles-encoding.json b/test/fixtures/tree/amps-and-angles-encoding.json index 98ba2e4e4..a2caf57c0 100644 --- a/test/fixtures/tree/amps-and-angles-encoding.json +++ b/test/fixtures/tree/amps-and-angles-encoding.json @@ -569,6 +569,7 @@ { "type": "definition", "identifier": "1", + "label": "1", "title": null, "url": "http://example.com/?foo=1&bar=2", "position": { @@ -588,6 +589,7 @@ { "type": "definition", "identifier": "2", + "label": "2", "title": "AT&T", "url": "http://att.com/", "position": { diff --git a/test/fixtures/tree/case-insensitive-refs.json b/test/fixtures/tree/case-insensitive-refs.json index e9a5b9722..6ed025866 100644 --- a/test/fixtures/tree/case-insensitive-refs.json +++ b/test/fixtures/tree/case-insensitive-refs.json @@ -59,6 +59,7 @@ { "type": "definition", "identifier": "hi", + "label": "HI", "title": null, "url": "/url", "position": { diff --git a/test/fixtures/tree/def-blocks.json b/test/fixtures/tree/def-blocks.json index aa75ea77a..27f713013 100644 --- a/test/fixtures/tree/def-blocks.json +++ b/test/fixtures/tree/def-blocks.json @@ -200,6 +200,7 @@ { "type": "definition", "identifier": "2", + "label": "2", "title": null, "url": "hello", "position": { @@ -465,6 +466,7 @@ { "type": "definition", "identifier": "4", + "label": "4", "title": null, "url": "hello", "position": { @@ -543,6 +545,7 @@ { "type": "definition", "identifier": "1", + "label": "1", "title": null, "url": "foo", "position": { diff --git a/test/fixtures/tree/definition-newline.commonmark.json b/test/fixtures/tree/definition-newline.commonmark.json index d9a6a4488..cb7b51787 100644 --- a/test/fixtures/tree/definition-newline.commonmark.json +++ b/test/fixtures/tree/definition-newline.commonmark.json @@ -291,6 +291,7 @@ { "type": "definition", "identifier": "baz", + "label": "baz", "title": "foo\nbar", "url": "/url", "position": { @@ -312,6 +313,7 @@ { "type": "definition", "identifier": "baz", + "label": "baz", "title": "foo\nbar", "url": "/url", "position": { diff --git a/test/fixtures/tree/definition-newline.json b/test/fixtures/tree/definition-newline.json index f2e198dbc..c16a01625 100644 --- a/test/fixtures/tree/definition-newline.json +++ b/test/fixtures/tree/definition-newline.json @@ -232,6 +232,7 @@ { "type": "definition", "identifier": "baz", + "label": "baz", "title": "foo\nbar", "url": "/url", "position": { @@ -253,6 +254,7 @@ { "type": "definition", "identifier": "baz", + "label": "baz", "title": "foo\nbar", "url": "/url", "position": { @@ -274,6 +276,7 @@ { "type": "definition", "identifier": "baz", + "label": "baz", "title": "foo\nbar", "url": "/url", "position": { diff --git a/test/fixtures/tree/definition-unclosed.json b/test/fixtures/tree/definition-unclosed.json index c6df27147..8b30bd24a 100644 --- a/test/fixtures/tree/definition-unclosed.json +++ b/test/fixtures/tree/definition-unclosed.json @@ -76,6 +76,7 @@ { "type": "definition", "identifier": "bar", + "label": "bar", "title": null, "url": " Date: Sat, 6 Oct 2018 10:37:38 +0200 Subject: [PATCH 2/7] remark-parse: add label to footnote definition --- packages/remark-parse/lib/tokenize/footnote-definition.js | 5 +++-- .../remark-stringify/lib/visitors/footnote-definition.js | 3 +-- test/fixtures/tree/footnote-consecutive.footnotes.json | 4 ++++ .../tree/footnote-consecutive.footnotes.pedantic.json | 4 ++++ test/fixtures/tree/footnote-duplicate.footnotes.json | 2 ++ .../fixtures/tree/footnote-duplicate.footnotes.pedantic.json | 2 ++ test/fixtures/tree/footnote-escape.footnotes.json | 1 + test/fixtures/tree/footnote-ids.footnotes.json | 1 + test/fixtures/tree/footnote-indent.footnotes.json | 1 + test/fixtures/tree/footnote-multiple.footnotes.json | 1 + test/fixtures/tree/footnote-multiple.footnotes.pedantic.json | 1 + test/fixtures/tree/footnote-nested.footnotes.json | 1 + test/fixtures/tree/footnote-proto.nooutput.footnotes.json | 3 +++ test/fixtures/tree/footnote-without-space.footnotes.json | 3 +++ test/fixtures/tree/footnote.footnotes.json | 2 ++ test/fixtures/tree/footnote.output.footnotes.json | 3 +++ test/fixtures/tree/list-continuation.footnotes.json | 1 + test/fixtures/tree/list-continuation.footnotes.pedantic.json | 1 + test/fixtures/tree/list-continuation.nogfm.footnotes.json | 1 + .../tree/list-continuation.nogfm.footnotes.pedantic.json | 1 + .../tree/nested-references.commonmark.footnotes.json | 1 + test/fixtures/tree/nested-references.footnotes.json | 1 + 22 files changed, 39 insertions(+), 4 deletions(-) diff --git a/packages/remark-parse/lib/tokenize/footnote-definition.js b/packages/remark-parse/lib/tokenize/footnote-definition.js index f48ff9bb7..4174a129f 100644 --- a/packages/remark-parse/lib/tokenize/footnote-definition.js +++ b/packages/remark-parse/lib/tokenize/footnote-definition.js @@ -93,7 +93,7 @@ function footnoteDefinition(eat, value, silent) { return true; } - identifier = normalize(queue); + identifier = queue; subvalue += queue + C_BRACKET_CLOSE + C_COLON; index = subvalue.length; @@ -179,7 +179,8 @@ function footnoteDefinition(eat, value, silent) { return add({ type: 'footnoteDefinition', - identifier: identifier, + identifier: normalize(identifier), + label: identifier, children: content }); } diff --git a/packages/remark-stringify/lib/visitors/footnote-definition.js b/packages/remark-stringify/lib/visitors/footnote-definition.js index 158f98ed9..a2e5daad8 100644 --- a/packages/remark-stringify/lib/visitors/footnote-definition.js +++ b/packages/remark-stringify/lib/visitors/footnote-definition.js @@ -5,8 +5,7 @@ var repeat = require('repeat-string'); module.exports = footnoteDefinition; function footnoteDefinition(node) { - var id = node.identifier.toLowerCase(); var content = this.all(node).join('\n\n' + repeat(' ', 4)); - return '[^' + id + ']: ' + content; + return '[^' + (node.label || node.identifier) + ']: ' + content; } diff --git a/test/fixtures/tree/footnote-consecutive.footnotes.json b/test/fixtures/tree/footnote-consecutive.footnotes.json index ec4984a54..93bee2ad2 100644 --- a/test/fixtures/tree/footnote-consecutive.footnotes.json +++ b/test/fixtures/tree/footnote-consecutive.footnotes.json @@ -229,6 +229,7 @@ { "type": "footnoteDefinition", "identifier": "wiki", + "label": "wiki", "children": [ { "type": "paragraph", @@ -283,6 +284,7 @@ { "type": "footnoteDefinition", "identifier": "wiki2", + "label": "wiki2", "children": [ { "type": "paragraph", @@ -337,6 +339,7 @@ { "type": "footnoteDefinition", "identifier": "name", + "label": "name", "children": [ { "type": "paragraph", @@ -391,6 +394,7 @@ { "type": "footnoteDefinition", "identifier": "consecutive", + "label": "consecutive", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/footnote-consecutive.footnotes.pedantic.json b/test/fixtures/tree/footnote-consecutive.footnotes.pedantic.json index ec4984a54..93bee2ad2 100644 --- a/test/fixtures/tree/footnote-consecutive.footnotes.pedantic.json +++ b/test/fixtures/tree/footnote-consecutive.footnotes.pedantic.json @@ -229,6 +229,7 @@ { "type": "footnoteDefinition", "identifier": "wiki", + "label": "wiki", "children": [ { "type": "paragraph", @@ -283,6 +284,7 @@ { "type": "footnoteDefinition", "identifier": "wiki2", + "label": "wiki2", "children": [ { "type": "paragraph", @@ -337,6 +339,7 @@ { "type": "footnoteDefinition", "identifier": "name", + "label": "name", "children": [ { "type": "paragraph", @@ -391,6 +394,7 @@ { "type": "footnoteDefinition", "identifier": "consecutive", + "label": "consecutive", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/footnote-duplicate.footnotes.json b/test/fixtures/tree/footnote-duplicate.footnotes.json index 2e87602fb..e5966adee 100644 --- a/test/fixtures/tree/footnote-duplicate.footnotes.json +++ b/test/fixtures/tree/footnote-duplicate.footnotes.json @@ -73,6 +73,7 @@ { "type": "footnoteDefinition", "identifier": "wiki", + "label": "wiki", "children": [ { "type": "paragraph", @@ -127,6 +128,7 @@ { "type": "footnoteDefinition", "identifier": "wiki", + "label": "wiki", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/footnote-duplicate.footnotes.pedantic.json b/test/fixtures/tree/footnote-duplicate.footnotes.pedantic.json index 2e87602fb..e5966adee 100644 --- a/test/fixtures/tree/footnote-duplicate.footnotes.pedantic.json +++ b/test/fixtures/tree/footnote-duplicate.footnotes.pedantic.json @@ -73,6 +73,7 @@ { "type": "footnoteDefinition", "identifier": "wiki", + "label": "wiki", "children": [ { "type": "paragraph", @@ -127,6 +128,7 @@ { "type": "footnoteDefinition", "identifier": "wiki", + "label": "wiki", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/footnote-escape.footnotes.json b/test/fixtures/tree/footnote-escape.footnotes.json index 5de359ac2..37d441c91 100644 --- a/test/fixtures/tree/footnote-escape.footnotes.json +++ b/test/fixtures/tree/footnote-escape.footnotes.json @@ -73,6 +73,7 @@ { "type": "footnoteDefinition", "identifier": "wi\\-ki", + "label": "wi\\-ki", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/footnote-ids.footnotes.json b/test/fixtures/tree/footnote-ids.footnotes.json index deaf32141..7063fd177 100644 --- a/test/fixtures/tree/footnote-ids.footnotes.json +++ b/test/fixtures/tree/footnote-ids.footnotes.json @@ -125,6 +125,7 @@ { "type": "footnoteDefinition", "identifier": "1", + "label": "1", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/footnote-indent.footnotes.json b/test/fixtures/tree/footnote-indent.footnotes.json index ad73659ed..d934bbfdb 100644 --- a/test/fixtures/tree/footnote-indent.footnotes.json +++ b/test/fixtures/tree/footnote-indent.footnotes.json @@ -73,6 +73,7 @@ { "type": "footnoteDefinition", "identifier": "wiki", + "label": "wiki", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/footnote-multiple.footnotes.json b/test/fixtures/tree/footnote-multiple.footnotes.json index f47ca8d5a..2ee378d66 100644 --- a/test/fixtures/tree/footnote-multiple.footnotes.json +++ b/test/fixtures/tree/footnote-multiple.footnotes.json @@ -161,6 +161,7 @@ { "type": "footnoteDefinition", "identifier": "wiki", + "label": "wiki", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/footnote-multiple.footnotes.pedantic.json b/test/fixtures/tree/footnote-multiple.footnotes.pedantic.json index f47ca8d5a..2ee378d66 100644 --- a/test/fixtures/tree/footnote-multiple.footnotes.pedantic.json +++ b/test/fixtures/tree/footnote-multiple.footnotes.pedantic.json @@ -161,6 +161,7 @@ { "type": "footnoteDefinition", "identifier": "wiki", + "label": "wiki", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/footnote-nested.footnotes.json b/test/fixtures/tree/footnote-nested.footnotes.json index 530500f3b..d694cdd04 100644 --- a/test/fixtures/tree/footnote-nested.footnotes.json +++ b/test/fixtures/tree/footnote-nested.footnotes.json @@ -73,6 +73,7 @@ { "type": "footnoteDefinition", "identifier": "1", + "label": "1", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/footnote-proto.nooutput.footnotes.json b/test/fixtures/tree/footnote-proto.nooutput.footnotes.json index 72241bf5b..78696c1b0 100644 --- a/test/fixtures/tree/footnote-proto.nooutput.footnotes.json +++ b/test/fixtures/tree/footnote-proto.nooutput.footnotes.json @@ -141,6 +141,7 @@ { "type": "footnoteDefinition", "identifier": "tostring", + "label": "toString", "children": [ { "type": "paragraph", @@ -229,6 +230,7 @@ { "type": "footnoteDefinition", "identifier": "constructor", + "label": "constructor", "children": [ { "type": "paragraph", @@ -317,6 +319,7 @@ { "type": "footnoteDefinition", "identifier": "__proto__", + "label": "__proto__", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/footnote-without-space.footnotes.json b/test/fixtures/tree/footnote-without-space.footnotes.json index cece74e80..cb1a7c7a0 100644 --- a/test/fixtures/tree/footnote-without-space.footnotes.json +++ b/test/fixtures/tree/footnote-without-space.footnotes.json @@ -327,6 +327,7 @@ { "type": "footnoteDefinition", "identifier": "abc", + "label": "abc", "children": [ { "type": "paragraph", @@ -381,6 +382,7 @@ { "type": "footnoteDefinition", "identifier": "xyz", + "label": "xyz", "children": [ { "type": "paragraph", @@ -435,6 +437,7 @@ { "type": "footnoteDefinition", "identifier": "footnote", + "label": "footnote", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/footnote.footnotes.json b/test/fixtures/tree/footnote.footnotes.json index 680d9b4f4..cb2f4fd79 100644 --- a/test/fixtures/tree/footnote.footnotes.json +++ b/test/fixtures/tree/footnote.footnotes.json @@ -73,6 +73,7 @@ { "type": "footnoteDefinition", "identifier": "somesamplefootnote", + "label": "somesamplefootnote", "children": [ { "type": "paragraph", @@ -250,6 +251,7 @@ { "type": "footnoteDefinition", "identifier": "documentdetails", + "label": "documentdetails", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/footnote.output.footnotes.json b/test/fixtures/tree/footnote.output.footnotes.json index c3c5b8d14..f4bb1f4f4 100644 --- a/test/fixtures/tree/footnote.output.footnotes.json +++ b/test/fixtures/tree/footnote.output.footnotes.json @@ -142,6 +142,7 @@ { "type": "footnoteDefinition", "identifier": "1", + "label": "1", "children": [ { "type": "paragraph", @@ -361,6 +362,7 @@ { "type": "footnoteDefinition", "identifier": "2", + "label": "2", "children": [ { "type": "paragraph", @@ -467,6 +469,7 @@ { "type": "footnoteDefinition", "identifier": "3", + "label": "3", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/list-continuation.footnotes.json b/test/fixtures/tree/list-continuation.footnotes.json index 339b012c6..7f4da8df0 100644 --- a/test/fixtures/tree/list-continuation.footnotes.json +++ b/test/fixtures/tree/list-continuation.footnotes.json @@ -386,6 +386,7 @@ { "type": "footnoteDefinition", "identifier": "foo", + "label": "foo", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/list-continuation.footnotes.pedantic.json b/test/fixtures/tree/list-continuation.footnotes.pedantic.json index 7bf74f03a..ce041f245 100644 --- a/test/fixtures/tree/list-continuation.footnotes.pedantic.json +++ b/test/fixtures/tree/list-continuation.footnotes.pedantic.json @@ -385,6 +385,7 @@ { "type": "footnoteDefinition", "identifier": "foo", + "label": "foo", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/list-continuation.nogfm.footnotes.json b/test/fixtures/tree/list-continuation.nogfm.footnotes.json index c3dd41fd9..2597a0a2b 100644 --- a/test/fixtures/tree/list-continuation.nogfm.footnotes.json +++ b/test/fixtures/tree/list-continuation.nogfm.footnotes.json @@ -398,6 +398,7 @@ { "type": "footnoteDefinition", "identifier": "foo", + "label": "foo", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/list-continuation.nogfm.footnotes.pedantic.json b/test/fixtures/tree/list-continuation.nogfm.footnotes.pedantic.json index ad838effe..291f4956e 100644 --- a/test/fixtures/tree/list-continuation.nogfm.footnotes.pedantic.json +++ b/test/fixtures/tree/list-continuation.nogfm.footnotes.pedantic.json @@ -389,6 +389,7 @@ { "type": "footnoteDefinition", "identifier": "foo", + "label": "foo", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/nested-references.commonmark.footnotes.json b/test/fixtures/tree/nested-references.commonmark.footnotes.json index 57fd28cde..8d21428c0 100644 --- a/test/fixtures/tree/nested-references.commonmark.footnotes.json +++ b/test/fixtures/tree/nested-references.commonmark.footnotes.json @@ -316,6 +316,7 @@ { "type": "footnoteDefinition", "identifier": "foo", + "label": "foo", "children": [ { "type": "paragraph", diff --git a/test/fixtures/tree/nested-references.footnotes.json b/test/fixtures/tree/nested-references.footnotes.json index 57fd28cde..8d21428c0 100644 --- a/test/fixtures/tree/nested-references.footnotes.json +++ b/test/fixtures/tree/nested-references.footnotes.json @@ -316,6 +316,7 @@ { "type": "footnoteDefinition", "identifier": "foo", + "label": "foo", "children": [ { "type": "paragraph", From 2c0aa76b5882a35423b3ec6c27d97e18b76c80e5 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Sat, 6 Oct 2018 11:04:55 +0200 Subject: [PATCH 3/7] remark-parse: add label to link reference --- .../remark-parse/lib/tokenize/reference.js | 4 ++ packages/remark-stringify/lib/util/label.js | 2 +- .../lib/visitors/link-reference.js | 2 +- .../tree/amps-and-angles-encoding.json | 2 + test/fixtures/tree/auto-link-url.nogfm.json | 1 + test/fixtures/tree/case-insensitive-refs.json | 1 + test/fixtures/tree/def-blocks.commonmark.json | 5 +++ test/fixtures/tree/def-blocks.json | 2 + .../tree/definition-newline.commonmark.json | 5 +++ test/fixtures/tree/definition-newline.json | 4 ++ .../tree/definition-unclosed-attribute.json | 9 ++++ .../tree/definition-unclosed.commonmark.json | 3 ++ test/fixtures/tree/definition-unclosed.json | 2 + .../tree/entities-advanced.commonmark.json | 2 + ...entities-advanced.commonmark.pedantic.json | 2 + test/fixtures/tree/entities-advanced.json | 2 + .../entities-advanced.nogfm.commonmark.json | 2 + ...es-advanced.nogfm.commonmark.pedantic.json | 2 + .../tree/entities-advanced.nogfm.json | 2 + .../entities-advanced.nogfm.pedantic.json | 2 + .../tree/entities-advanced.pedantic.json | 2 + .../tree/entities.output.entities.json | 4 ++ .../tree/entities.output.entities=escape.json | 4 ++ .../entities.output.entities=numbers.json | 4 ++ .../tree/entities.output.noentities.json | 4 ++ test/fixtures/tree/footnote-consecutive.json | 7 +++ test/fixtures/tree/footnote-duplicate.json | 3 ++ .../tree/footnote-duplicate.pedantic.json | 3 ++ test/fixtures/tree/footnote-escape.json | 2 + test/fixtures/tree/footnote-ids.json | 3 ++ test/fixtures/tree/footnote-indent.json | 2 + test/fixtures/tree/footnote-inline.json | 1 + .../tree/footnote-like.footnotes.json | 2 + test/fixtures/tree/footnote-like.json | 3 ++ .../tree/footnote-matrix.footnotes.json | 3 ++ test/fixtures/tree/footnote-matrix.json | 4 ++ test/fixtures/tree/footnote-multiple.json | 3 ++ .../tree/footnote-multiple.pedantic.json | 3 ++ test/fixtures/tree/footnote-nested.json | 3 ++ .../tree/footnote-proto.nooutput.json | 6 +++ .../fixtures/tree/footnote-without-space.json | 6 +++ test/fixtures/tree/footnote.footnotes.json | 2 + test/fixtures/tree/footnote.json | 5 +++ .../fixtures/tree/link-spaces.commonmark.json | 1 + test/fixtures/tree/link-spaces.json | 1 + .../tree/link-spaces.nogfm.commonmark.json | 1 + test/fixtures/tree/link-spaces.nogfm.json | 1 + .../tree/link-whitespace.commonmark.json | 3 ++ test/fixtures/tree/link-whitespace.json | 3 ++ .../tree/links-inline-style.commonmark.json | 2 + test/fixtures/tree/links-inline-style.json | 2 + test/fixtures/tree/links-reference-proto.json | 3 ++ test/fixtures/tree/links-reference-style.json | 20 +++++++++ .../tree/links-shortcut-references.json | 5 +++ ...e-double-quotes-delimiters.commonmark.json | 2 + ...otes-mismatched-delimiters.commonmark.json | 2 + .../tree/links-title-empty-parentheses.json | 2 + .../links-title-empty-parentheses.nogfm.json | 2 + .../tree/links-title-parentheses.json | 2 + .../tree/links-title-parentheses.nogfm.json | 2 + ...e-single-quotes-delimiters.commonmark.json | 2 + ...otes-mismatched-delimiters.commonmark.json | 2 + .../tree/links-title-unclosed.commonmark.json | 6 +++ test/fixtures/tree/links-title-unclosed.json | 6 +++ .../tree/links-title-unclosed.nogfm.json | 6 +++ .../links-url-empty-title-parentheses.json | 1 + ...nks-url-empty-title-parentheses.nogfm.json | 1 + ...url-mismatched-parentheses.commonmark.json | 1 + .../links-url-mismatched-parentheses.json | 1 + ...inks-url-mismatched-parentheses.nogfm.json | 1 + .../tree/links-url-new-line.commonmark.json | 2 + test/fixtures/tree/links-url-new-line.json | 1 + .../tree/links-url-new-line.nogfm.json | 1 + test/fixtures/tree/links-url-unclosed.json | 2 + .../links-url-white-space.commonmark.json | 1 + test/fixtures/tree/links-url-white-space.json | 1 + .../tree/links-url-white-space.nogfm.json | 1 + ...ist-continuation.commonmark.footnotes.json | 2 + ...nuation.commonmark.footnotes.pedantic.json | 2 + .../tree/list-continuation.commonmark.json | 4 ++ ...list-continuation.commonmark.pedantic.json | 4 ++ .../tree/list-continuation.footnotes.json | 1 + .../list-continuation.footnotes.pedantic.json | 1 + test/fixtures/tree/list-continuation.json | 2 + ...ntinuation.nogfm.commonmark.footnotes.json | 2 + ...n.nogfm.commonmark.footnotes.pedantic.json | 2 + .../list-continuation.nogfm.commonmark.json | 4 ++ ...ontinuation.nogfm.commonmark.pedantic.json | 4 ++ .../list-continuation.nogfm.footnotes.json | 1 + ...continuation.nogfm.footnotes.pedantic.json | 1 + .../tree/list-continuation.nogfm.json | 2 + .../list-continuation.nogfm.pedantic.json | 2 + .../tree/list-continuation.pedantic.json | 2 + test/fixtures/tree/main.json | 1 + test/fixtures/tree/main.nogfm.json | 1 + test/fixtures/tree/main.nogfm.pedantic.json | 1 + test/fixtures/tree/main.pedantic.json | 1 + .../tree/markdown-documentation-basics.json | 3 ++ ...kdown-documentation-syntax.commonmark.json | 21 +++++++++ ...umentation-syntax.commonmark.pedantic.json | 21 +++++++++ .../tree/markdown-documentation-syntax.json | 12 ++++++ ...documentation-syntax.nogfm.commonmark.json | 21 +++++++++ ...tion-syntax.nogfm.commonmark.pedantic.json | 21 +++++++++ .../markdown-documentation-syntax.nogfm.json | 12 ++++++ ...n-documentation-syntax.nogfm.pedantic.json | 12 ++++++ ...arkdown-documentation-syntax.pedantic.json | 12 ++++++ ...ested-references.commonmark.footnotes.json | 3 ++ .../tree/nested-references.commonmark.json | 4 ++ .../tree/nested-references.footnotes.json | 3 ++ test/fixtures/tree/nested-references.json | 4 ++ .../tree/nested-square-link.commonmark.json | 1 + test/fixtures/tree/nested-square-link.json | 1 + test/fixtures/tree/ref-paren.json | 1 + .../tree/reference-link-escape.nooutput.json | 3 ++ .../tree/reference-link-not-closed.json | 3 ++ .../reference-link-with-angle-brackets.json | 1 + ...erence-link-with-multiple-definitions.json | 1 + .../tree/stringify-escape.commonmark.json | 8 ++++ .../stringify-escape.commonmark.pedantic.json | 8 ++++ test/fixtures/tree/stringify-escape.json | 8 ++++ .../stringify-escape.nogfm.commonmark.json | 8 ++++ ...gify-escape.nogfm.commonmark.pedantic.json | 8 ++++ .../fixtures/tree/stringify-escape.nogfm.json | 8 ++++ .../tree/stringify-escape.nogfm.pedantic.json | 8 ++++ ...y-escape.output.commonmark.commonmark.json | 8 ++++ .../tree/stringify-escape.output.json | 8 ++++ ...put.nogfm.commonmark.nogfm.commonmark.json | 8 ++++ .../stringify-escape.output.nogfm.nogfm.json | 8 ++++ ...position.pedantic.noposition.pedantic.json | 8 ++++ ...ngify-escape.output.pedantic.pedantic.json | 8 ++++ .../tree/stringify-escape.pedantic.json | 8 ++++ .../tree/task-list-ordered.nogfm.json | 4 ++ .../task-list-ordered.nogfm.pedantic.json | 4 ++ .../task-list-unordered-asterisk.nogfm.json | 4 ++ ...ist-unordered-asterisk.nogfm.pedantic.json | 4 ++ .../tree/task-list-unordered-dash.nogfm.json | 4 ++ ...sk-list-unordered-dash.nogfm.pedantic.json | 4 ++ .../tree/task-list-unordered-plus.nogfm.json | 4 ++ ...sk-list-unordered-plus.nogfm.pedantic.json | 4 ++ test/fixtures/tree/task-list.commonmark.json | 14 ++++++ test/fixtures/tree/task-list.json | 14 ++++++ .../tree/task-list.nogfm.commonmark.json | 43 +++++++++++++++++++ test/fixtures/tree/task-list.nogfm.json | 43 +++++++++++++++++++ .../tree/title-attributes.commonmark.json | 4 ++ test/fixtures/tree/title-attributes.json | 6 +++ .../title-attributes.nogfm.commonmark.json | 4 ++ .../fixtures/tree/title-attributes.nogfm.json | 6 +++ .../tree/toplevel-paragraphs.commonmark.json | 2 + test/fixtures/tree/toplevel-paragraphs.json | 1 + .../toplevel-paragraphs.nogfm.commonmark.json | 2 + .../tree/toplevel-paragraphs.nogfm.json | 1 + 151 files changed, 707 insertions(+), 2 deletions(-) diff --git a/packages/remark-parse/lib/tokenize/reference.js b/packages/remark-parse/lib/tokenize/reference.js index 0db5eb3c6..30f482d98 100644 --- a/packages/remark-parse/lib/tokenize/reference.js +++ b/packages/remark-parse/lib/tokenize/reference.js @@ -196,6 +196,10 @@ function reference(eat, value, silent) { identifier: normalize(identifier) }; + if (type === T_LINK) { + node.label = identifier; + } + if (type === T_LINK || type === T_IMAGE) { node.referenceType = referenceType; } diff --git a/packages/remark-stringify/lib/util/label.js b/packages/remark-stringify/lib/util/label.js index bf6f5876b..cd99211be 100644 --- a/packages/remark-stringify/lib/util/label.js +++ b/packages/remark-stringify/lib/util/label.js @@ -10,7 +10,7 @@ module.exports = label; * changes. */ function label(node) { var type = node.referenceType; - var value = type === 'full' ? node.identifier : ''; + var value = type === 'full' ? node.label || node.identifier : ''; return type === 'shortcut' ? value : '[' + value + ']'; } diff --git a/packages/remark-stringify/lib/visitors/link-reference.js b/packages/remark-stringify/lib/visitors/link-reference.js index a8e52a4d4..b8b7cc9d3 100644 --- a/packages/remark-stringify/lib/visitors/link-reference.js +++ b/packages/remark-stringify/lib/visitors/link-reference.js @@ -14,7 +14,7 @@ function linkReference(node) { exit(); if (type === 'shortcut' || type === 'collapsed') { - value = copy(value, node.identifier); + value = copy(value, node.label || node.identifier); } return '[' + value + ']' + label(node); diff --git a/test/fixtures/tree/amps-and-angles-encoding.json b/test/fixtures/tree/amps-and-angles-encoding.json index a2caf57c0..97fd4b776 100644 --- a/test/fixtures/tree/amps-and-angles-encoding.json +++ b/test/fixtures/tree/amps-and-angles-encoding.json @@ -233,6 +233,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "full", "children": [ { @@ -322,6 +323,7 @@ { "type": "linkReference", "identifier": "2", + "label": "2", "referenceType": "full", "children": [ { diff --git a/test/fixtures/tree/auto-link-url.nogfm.json b/test/fixtures/tree/auto-link-url.nogfm.json index 6543edaa4..63cf3bc77 100644 --- a/test/fixtures/tree/auto-link-url.nogfm.json +++ b/test/fixtures/tree/auto-link-url.nogfm.json @@ -59,6 +59,7 @@ { "type": "linkReference", "identifier": "world", + "label": "world", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/case-insensitive-refs.json b/test/fixtures/tree/case-insensitive-refs.json index 6ed025866..3142ea6a1 100644 --- a/test/fixtures/tree/case-insensitive-refs.json +++ b/test/fixtures/tree/case-insensitive-refs.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hi", + "label": "hi", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/def-blocks.commonmark.json b/test/fixtures/tree/def-blocks.commonmark.json index 07649e888..bad8410a3 100644 --- a/test/fixtures/tree/def-blocks.commonmark.json +++ b/test/fixtures/tree/def-blocks.commonmark.json @@ -29,6 +29,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { @@ -158,6 +159,7 @@ { "type": "linkReference", "identifier": "2", + "label": "2", "referenceType": "shortcut", "children": [ { @@ -315,6 +317,7 @@ { "type": "linkReference", "identifier": "3", + "label": "3", "referenceType": "shortcut", "children": [ { @@ -449,6 +452,7 @@ { "type": "linkReference", "identifier": "4", + "label": "4", "referenceType": "shortcut", "children": [ { @@ -580,6 +584,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/def-blocks.json b/test/fixtures/tree/def-blocks.json index 27f713013..c0254c7b9 100644 --- a/test/fixtures/tree/def-blocks.json +++ b/test/fixtures/tree/def-blocks.json @@ -45,6 +45,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { @@ -289,6 +290,7 @@ { "type": "linkReference", "identifier": "3", + "label": "3", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/definition-newline.commonmark.json b/test/fixtures/tree/definition-newline.commonmark.json index cb7b51787..e82ee82b6 100644 --- a/test/fixtures/tree/definition-newline.commonmark.json +++ b/test/fixtures/tree/definition-newline.commonmark.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "shortcut", "children": [ { @@ -83,6 +84,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { @@ -159,6 +161,7 @@ { "type": "linkReference", "identifier": "bar", + "label": "bar", "referenceType": "shortcut", "children": [ { @@ -216,6 +219,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "shortcut", "children": [ { @@ -338,6 +342,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/definition-newline.json b/test/fixtures/tree/definition-newline.json index c16a01625..6d43b85eb 100644 --- a/test/fixtures/tree/definition-newline.json +++ b/test/fixtures/tree/definition-newline.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "shortcut", "children": [ { @@ -83,6 +84,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { @@ -159,6 +161,7 @@ { "type": "linkReference", "identifier": "bar", + "label": "bar", "referenceType": "shortcut", "children": [ { @@ -301,6 +304,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/definition-unclosed-attribute.json b/test/fixtures/tree/definition-unclosed-attribute.json index 4bb12e91d..e36b83dec 100644 --- a/test/fixtures/tree/definition-unclosed-attribute.json +++ b/test/fixtures/tree/definition-unclosed-attribute.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "shortcut", "children": [ { @@ -79,6 +80,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { @@ -151,6 +153,7 @@ { "type": "linkReference", "identifier": "bar", + "label": "bar", "referenceType": "shortcut", "children": [ { @@ -223,6 +226,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "shortcut", "children": [ { @@ -295,6 +299,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { @@ -367,6 +372,7 @@ { "type": "linkReference", "identifier": "bar", + "label": "bar", "referenceType": "shortcut", "children": [ { @@ -439,6 +445,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "shortcut", "children": [ { @@ -545,6 +552,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { @@ -651,6 +659,7 @@ { "type": "linkReference", "identifier": "bar", + "label": "bar", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/definition-unclosed.commonmark.json b/test/fixtures/tree/definition-unclosed.commonmark.json index 490209d26..6a4815c0f 100644 --- a/test/fixtures/tree/definition-unclosed.commonmark.json +++ b/test/fixtures/tree/definition-unclosed.commonmark.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { @@ -79,6 +80,7 @@ { "type": "linkReference", "identifier": "bar", + "label": "bar", "referenceType": "shortcut", "children": [ { @@ -151,6 +153,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/definition-unclosed.json b/test/fixtures/tree/definition-unclosed.json index 8b30bd24a..5d2c0ccaf 100644 --- a/test/fixtures/tree/definition-unclosed.json +++ b/test/fixtures/tree/definition-unclosed.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { @@ -99,6 +100,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/entities-advanced.commonmark.json b/test/fixtures/tree/entities-advanced.commonmark.json index 20436e555..3973b342f 100644 --- a/test/fixtures/tree/entities-advanced.commonmark.json +++ b/test/fixtures/tree/entities-advanced.commonmark.json @@ -949,6 +949,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { @@ -1167,6 +1168,7 @@ { "type": "linkReference", "identifier": " 1 ", + "label": "\n 1\n", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/entities-advanced.commonmark.pedantic.json b/test/fixtures/tree/entities-advanced.commonmark.pedantic.json index 20436e555..3973b342f 100644 --- a/test/fixtures/tree/entities-advanced.commonmark.pedantic.json +++ b/test/fixtures/tree/entities-advanced.commonmark.pedantic.json @@ -949,6 +949,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { @@ -1167,6 +1168,7 @@ { "type": "linkReference", "identifier": " 1 ", + "label": "\n 1\n", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/entities-advanced.json b/test/fixtures/tree/entities-advanced.json index 9de9f0790..1abaaca0d 100644 --- a/test/fixtures/tree/entities-advanced.json +++ b/test/fixtures/tree/entities-advanced.json @@ -792,6 +792,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { @@ -990,6 +991,7 @@ { "type": "linkReference", "identifier": " 1 ", + "label": "\n 1\n", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/entities-advanced.nogfm.commonmark.json b/test/fixtures/tree/entities-advanced.nogfm.commonmark.json index 0abb83103..223460a2b 100644 --- a/test/fixtures/tree/entities-advanced.nogfm.commonmark.json +++ b/test/fixtures/tree/entities-advanced.nogfm.commonmark.json @@ -914,6 +914,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { @@ -1078,6 +1079,7 @@ { "type": "linkReference", "identifier": " 1 ", + "label": "\n 1\n", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/entities-advanced.nogfm.commonmark.pedantic.json b/test/fixtures/tree/entities-advanced.nogfm.commonmark.pedantic.json index 0abb83103..223460a2b 100644 --- a/test/fixtures/tree/entities-advanced.nogfm.commonmark.pedantic.json +++ b/test/fixtures/tree/entities-advanced.nogfm.commonmark.pedantic.json @@ -914,6 +914,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { @@ -1078,6 +1079,7 @@ { "type": "linkReference", "identifier": " 1 ", + "label": "\n 1\n", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/entities-advanced.nogfm.json b/test/fixtures/tree/entities-advanced.nogfm.json index ca405ccea..b3c08ba42 100644 --- a/test/fixtures/tree/entities-advanced.nogfm.json +++ b/test/fixtures/tree/entities-advanced.nogfm.json @@ -757,6 +757,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { @@ -901,6 +902,7 @@ { "type": "linkReference", "identifier": " 1 ", + "label": "\n 1\n", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/entities-advanced.nogfm.pedantic.json b/test/fixtures/tree/entities-advanced.nogfm.pedantic.json index ca405ccea..b3c08ba42 100644 --- a/test/fixtures/tree/entities-advanced.nogfm.pedantic.json +++ b/test/fixtures/tree/entities-advanced.nogfm.pedantic.json @@ -757,6 +757,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { @@ -901,6 +902,7 @@ { "type": "linkReference", "identifier": " 1 ", + "label": "\n 1\n", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/entities-advanced.pedantic.json b/test/fixtures/tree/entities-advanced.pedantic.json index 9de9f0790..1abaaca0d 100644 --- a/test/fixtures/tree/entities-advanced.pedantic.json +++ b/test/fixtures/tree/entities-advanced.pedantic.json @@ -792,6 +792,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { @@ -990,6 +991,7 @@ { "type": "linkReference", "identifier": " 1 ", + "label": "\n 1\n", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/entities.output.entities.json b/test/fixtures/tree/entities.output.entities.json index c0eed0104..6849cadf5 100644 --- a/test/fixtures/tree/entities.output.entities.json +++ b/test/fixtures/tree/entities.output.entities.json @@ -1978,6 +1978,7 @@ { "type": "linkReference", "identifier": "foo&bar", + "label": "foo&bar", "referenceType": "shortcut", "children": [ { @@ -2032,6 +2033,7 @@ { "type": "linkReference", "identifier": "foo&bar", + "label": "foo&bar", "referenceType": "collapsed", "children": [ { @@ -2086,6 +2088,7 @@ { "type": "linkReference", "identifier": "foo&bar", + "label": "foo&bar", "referenceType": "shortcut", "children": [ { @@ -2174,6 +2177,7 @@ { "type": "linkReference", "identifier": "foo&bar", + "label": "foo&bar", "referenceType": "collapsed", "children": [ { diff --git a/test/fixtures/tree/entities.output.entities=escape.json b/test/fixtures/tree/entities.output.entities=escape.json index 60d452d2b..dda722898 100644 --- a/test/fixtures/tree/entities.output.entities=escape.json +++ b/test/fixtures/tree/entities.output.entities=escape.json @@ -1944,6 +1944,7 @@ { "type": "linkReference", "identifier": "foo&bar", + "label": "foo&bar", "referenceType": "shortcut", "children": [ { @@ -1998,6 +1999,7 @@ { "type": "linkReference", "identifier": "foo&bar", + "label": "foo&bar", "referenceType": "collapsed", "children": [ { @@ -2052,6 +2054,7 @@ { "type": "linkReference", "identifier": "foo&bar", + "label": "foo&bar", "referenceType": "shortcut", "children": [ { @@ -2140,6 +2143,7 @@ { "type": "linkReference", "identifier": "foo&bar", + "label": "foo&bar", "referenceType": "collapsed", "children": [ { diff --git a/test/fixtures/tree/entities.output.entities=numbers.json b/test/fixtures/tree/entities.output.entities=numbers.json index ab6c3a3ab..bec1d28c0 100644 --- a/test/fixtures/tree/entities.output.entities=numbers.json +++ b/test/fixtures/tree/entities.output.entities=numbers.json @@ -1978,6 +1978,7 @@ { "type": "linkReference", "identifier": "foo&bar", + "label": "foo&bar", "referenceType": "shortcut", "children": [ { @@ -2032,6 +2033,7 @@ { "type": "linkReference", "identifier": "foo&bar", + "label": "foo&bar", "referenceType": "collapsed", "children": [ { @@ -2086,6 +2088,7 @@ { "type": "linkReference", "identifier": "foo&bar", + "label": "foo&bar", "referenceType": "shortcut", "children": [ { @@ -2174,6 +2177,7 @@ { "type": "linkReference", "identifier": "foo&bar", + "label": "foo&bar", "referenceType": "collapsed", "children": [ { diff --git a/test/fixtures/tree/entities.output.noentities.json b/test/fixtures/tree/entities.output.noentities.json index d6127ebd2..8d4e5042f 100644 --- a/test/fixtures/tree/entities.output.noentities.json +++ b/test/fixtures/tree/entities.output.noentities.json @@ -1740,6 +1740,7 @@ { "type": "linkReference", "identifier": "foo&bar", + "label": "foo&bar", "referenceType": "shortcut", "children": [ { @@ -1794,6 +1795,7 @@ { "type": "linkReference", "identifier": "foo&bar", + "label": "foo&bar", "referenceType": "collapsed", "children": [ { @@ -1848,6 +1850,7 @@ { "type": "linkReference", "identifier": "foo&bar", + "label": "foo&bar", "referenceType": "shortcut", "children": [ { @@ -1936,6 +1939,7 @@ { "type": "linkReference", "identifier": "foo&bar", + "label": "foo&bar", "referenceType": "collapsed", "children": [ { diff --git a/test/fixtures/tree/footnote-consecutive.json b/test/fixtures/tree/footnote-consecutive.json index 79013833e..91a42c609 100644 --- a/test/fixtures/tree/footnote-consecutive.json +++ b/test/fixtures/tree/footnote-consecutive.json @@ -25,6 +25,7 @@ { "type": "linkReference", "identifier": "^wiki", + "label": "^wiki", "referenceType": "shortcut", "children": [ { @@ -97,6 +98,7 @@ { "type": "linkReference", "identifier": "^wiki2", + "label": "^wiki2", "referenceType": "full", "children": [ { @@ -151,6 +153,7 @@ { "type": "linkReference", "identifier": "^consecutive", + "label": "^consecutive", "referenceType": "full", "children": [ { @@ -258,6 +261,7 @@ { "type": "linkReference", "identifier": "^wiki", + "label": "^wiki", "referenceType": "shortcut", "children": [ { @@ -314,6 +318,7 @@ { "type": "linkReference", "identifier": "^wiki2", + "label": "^wiki2", "referenceType": "shortcut", "children": [ { @@ -370,6 +375,7 @@ { "type": "linkReference", "identifier": "^name", + "label": "^name", "referenceType": "shortcut", "children": [ { @@ -426,6 +432,7 @@ { "type": "linkReference", "identifier": "^consecutive", + "label": "^consecutive", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/footnote-duplicate.json b/test/fixtures/tree/footnote-duplicate.json index ba6022b0c..64ca743b0 100644 --- a/test/fixtures/tree/footnote-duplicate.json +++ b/test/fixtures/tree/footnote-duplicate.json @@ -24,6 +24,7 @@ { "type": "linkReference", "identifier": "^wiki", + "label": "^wiki", "referenceType": "shortcut", "children": [ { @@ -96,6 +97,7 @@ { "type": "linkReference", "identifier": "^wiki", + "label": "^wiki", "referenceType": "shortcut", "children": [ { @@ -152,6 +154,7 @@ { "type": "linkReference", "identifier": "^wiki", + "label": "^wiki", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/footnote-duplicate.pedantic.json b/test/fixtures/tree/footnote-duplicate.pedantic.json index ba6022b0c..64ca743b0 100644 --- a/test/fixtures/tree/footnote-duplicate.pedantic.json +++ b/test/fixtures/tree/footnote-duplicate.pedantic.json @@ -24,6 +24,7 @@ { "type": "linkReference", "identifier": "^wiki", + "label": "^wiki", "referenceType": "shortcut", "children": [ { @@ -96,6 +97,7 @@ { "type": "linkReference", "identifier": "^wiki", + "label": "^wiki", "referenceType": "shortcut", "children": [ { @@ -152,6 +154,7 @@ { "type": "linkReference", "identifier": "^wiki", + "label": "^wiki", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/footnote-escape.json b/test/fixtures/tree/footnote-escape.json index 935064388..91d3c4463 100644 --- a/test/fixtures/tree/footnote-escape.json +++ b/test/fixtures/tree/footnote-escape.json @@ -24,6 +24,7 @@ { "type": "linkReference", "identifier": "^wi\\-ki", + "label": "^wi\\-ki", "referenceType": "shortcut", "children": [ { @@ -130,6 +131,7 @@ { "type": "linkReference", "identifier": "^wi\\-ki", + "label": "^wi\\-ki", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/footnote-ids.json b/test/fixtures/tree/footnote-ids.json index 44e20ed22..0e522e5e8 100644 --- a/test/fixtures/tree/footnote-ids.json +++ b/test/fixtures/tree/footnote-ids.json @@ -24,6 +24,7 @@ { "type": "linkReference", "identifier": "^the generated", + "label": "^the generated", "referenceType": "shortcut", "children": [ { @@ -78,6 +79,7 @@ { "type": "linkReference", "identifier": "^1", + "label": "^1", "referenceType": "shortcut", "children": [ { @@ -150,6 +152,7 @@ { "type": "linkReference", "identifier": "^1", + "label": "^1", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/footnote-indent.json b/test/fixtures/tree/footnote-indent.json index c4777eed2..cd85bf7f6 100644 --- a/test/fixtures/tree/footnote-indent.json +++ b/test/fixtures/tree/footnote-indent.json @@ -24,6 +24,7 @@ { "type": "linkReference", "identifier": "^wiki", + "label": "^wiki", "referenceType": "shortcut", "children": [ { @@ -113,6 +114,7 @@ { "type": "linkReference", "identifier": "^wiki", + "label": "^wiki", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/footnote-inline.json b/test/fixtures/tree/footnote-inline.json index 2e88e6582..3241c6d7b 100644 --- a/test/fixtures/tree/footnote-inline.json +++ b/test/fixtures/tree/footnote-inline.json @@ -24,6 +24,7 @@ { "type": "linkReference", "identifier": "^this is the _actual_ footnote.", + "label": "^This is the _actual_ footnote.", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/footnote-like.footnotes.json b/test/fixtures/tree/footnote-like.footnotes.json index 3132b6d41..ddfa7ad55 100644 --- a/test/fixtures/tree/footnote-like.footnotes.json +++ b/test/fixtures/tree/footnote-like.footnotes.json @@ -24,6 +24,7 @@ { "type": "linkReference", "identifier": "^foo", + "label": "^foo", "referenceType": "full", "children": [ { @@ -113,6 +114,7 @@ { "type": "linkReference", "identifier": "invalid", + "label": "invalid", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/footnote-like.json b/test/fixtures/tree/footnote-like.json index 009ce650b..91919507f 100644 --- a/test/fixtures/tree/footnote-like.json +++ b/test/fixtures/tree/footnote-like.json @@ -24,6 +24,7 @@ { "type": "linkReference", "identifier": "^foo", + "label": "^foo", "referenceType": "full", "children": [ { @@ -96,6 +97,7 @@ { "type": "linkReference", "identifier": "invalid", + "label": "invalid", "referenceType": "full", "children": [ { @@ -150,6 +152,7 @@ { "type": "linkReference", "identifier": "^this too", + "label": "^this too", "referenceType": "collapsed", "children": [ { diff --git a/test/fixtures/tree/footnote-matrix.footnotes.json b/test/fixtures/tree/footnote-matrix.footnotes.json index 415bd7529..550fb3281 100644 --- a/test/fixtures/tree/footnote-matrix.footnotes.json +++ b/test/fixtures/tree/footnote-matrix.footnotes.json @@ -18,6 +18,7 @@ { "type": "linkReference", "identifier": "bar", + "label": "bar", "referenceType": "full", "children": [ { @@ -110,6 +111,7 @@ { "type": "linkReference", "identifier": "bar", + "label": "bar", "referenceType": "shortcut", "children": [ { @@ -185,6 +187,7 @@ { "type": "linkReference", "identifier": "^bar", + "label": "^bar", "referenceType": "full", "children": [ { diff --git a/test/fixtures/tree/footnote-matrix.json b/test/fixtures/tree/footnote-matrix.json index 149a3b0ed..cc58ea5d9 100644 --- a/test/fixtures/tree/footnote-matrix.json +++ b/test/fixtures/tree/footnote-matrix.json @@ -18,6 +18,7 @@ { "type": "linkReference", "identifier": "bar", + "label": "bar", "referenceType": "full", "children": [ { @@ -93,6 +94,7 @@ { "type": "linkReference", "identifier": "bar", + "label": "bar", "referenceType": "full", "children": [ { @@ -168,6 +170,7 @@ { "type": "linkReference", "identifier": "^bar", + "label": "^bar", "referenceType": "full", "children": [ { @@ -243,6 +246,7 @@ { "type": "linkReference", "identifier": "^bar", + "label": "^bar", "referenceType": "full", "children": [ { diff --git a/test/fixtures/tree/footnote-multiple.json b/test/fixtures/tree/footnote-multiple.json index 0f1326950..a43106eb7 100644 --- a/test/fixtures/tree/footnote-multiple.json +++ b/test/fixtures/tree/footnote-multiple.json @@ -25,6 +25,7 @@ { "type": "linkReference", "identifier": "^wiki", + "label": "^wiki", "referenceType": "shortcut", "children": [ { @@ -97,6 +98,7 @@ { "type": "linkReference", "identifier": "^wiki", + "label": "^wiki", "referenceType": "shortcut", "children": [ { @@ -204,6 +206,7 @@ { "type": "linkReference", "identifier": "^wiki", + "label": "^wiki", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/footnote-multiple.pedantic.json b/test/fixtures/tree/footnote-multiple.pedantic.json index 0f1326950..a43106eb7 100644 --- a/test/fixtures/tree/footnote-multiple.pedantic.json +++ b/test/fixtures/tree/footnote-multiple.pedantic.json @@ -25,6 +25,7 @@ { "type": "linkReference", "identifier": "^wiki", + "label": "^wiki", "referenceType": "shortcut", "children": [ { @@ -97,6 +98,7 @@ { "type": "linkReference", "identifier": "^wiki", + "label": "^wiki", "referenceType": "shortcut", "children": [ { @@ -204,6 +206,7 @@ { "type": "linkReference", "identifier": "^wiki", + "label": "^wiki", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/footnote-nested.json b/test/fixtures/tree/footnote-nested.json index a76952726..f00a67cd8 100644 --- a/test/fixtures/tree/footnote-nested.json +++ b/test/fixtures/tree/footnote-nested.json @@ -24,6 +24,7 @@ { "type": "linkReference", "identifier": "^1", + "label": "^1", "referenceType": "shortcut", "children": [ { @@ -96,6 +97,7 @@ { "type": "linkReference", "identifier": "^1", + "label": "^1", "referenceType": "shortcut", "children": [ { @@ -150,6 +152,7 @@ { "type": "linkReference", "identifier": "^another **footnote**", + "label": "^another **footnote**", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/footnote-proto.nooutput.json b/test/fixtures/tree/footnote-proto.nooutput.json index deec1e6a1..d7393549a 100644 --- a/test/fixtures/tree/footnote-proto.nooutput.json +++ b/test/fixtures/tree/footnote-proto.nooutput.json @@ -24,6 +24,7 @@ { "type": "linkReference", "identifier": "^tostring", + "label": "^toString", "referenceType": "shortcut", "children": [ { @@ -78,6 +79,7 @@ { "type": "linkReference", "identifier": "^__proto__", + "label": "^__proto__", "referenceType": "shortcut", "children": [ { @@ -167,6 +169,7 @@ { "type": "linkReference", "identifier": "^constructor", + "label": "^constructor", "referenceType": "shortcut", "children": [ { @@ -239,6 +242,7 @@ { "type": "linkReference", "identifier": "^tostring", + "label": "^toString", "referenceType": "shortcut", "children": [ { @@ -329,6 +333,7 @@ { "type": "linkReference", "identifier": "^constructor", + "label": "^constructor", "referenceType": "shortcut", "children": [ { @@ -419,6 +424,7 @@ { "type": "linkReference", "identifier": "^__proto__", + "label": "^__proto__", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/footnote-without-space.json b/test/fixtures/tree/footnote-without-space.json index 7b1a85354..22bdddd9e 100644 --- a/test/fixtures/tree/footnote-without-space.json +++ b/test/fixtures/tree/footnote-without-space.json @@ -24,6 +24,7 @@ { "type": "linkReference", "identifier": "^abc", + "label": "^abc", "referenceType": "shortcut", "children": [ { @@ -78,6 +79,7 @@ { "type": "linkReference", "identifier": "^xyz", + "label": "^xyz", "referenceType": "shortcut", "children": [ { @@ -260,6 +262,7 @@ { "type": "linkReference", "identifier": "^footnote", + "label": "^footnote", "referenceType": "shortcut", "children": [ { @@ -354,6 +357,7 @@ { "type": "linkReference", "identifier": "^footnote", + "label": "^footnote", "referenceType": "shortcut", "children": [ { @@ -412,6 +416,7 @@ { "type": "linkReference", "identifier": "^abc", + "label": "^abc", "referenceType": "shortcut", "children": [ { @@ -504,6 +509,7 @@ { "type": "linkReference", "identifier": "^footnote", + "label": "^footnote", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/footnote.footnotes.json b/test/fixtures/tree/footnote.footnotes.json index cb2f4fd79..3f151d812 100644 --- a/test/fixtures/tree/footnote.footnotes.json +++ b/test/fixtures/tree/footnote.footnotes.json @@ -148,6 +148,7 @@ { "type": "linkReference", "identifier": "paragraph", + "label": "paragraph", "referenceType": "shortcut", "children": [ { @@ -363,6 +364,7 @@ { "type": "linkReference", "identifier": "paragraph", + "label": "paragraph", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/footnote.json b/test/fixtures/tree/footnote.json index 816af70c9..33a6c945a 100644 --- a/test/fixtures/tree/footnote.json +++ b/test/fixtures/tree/footnote.json @@ -24,6 +24,7 @@ { "type": "linkReference", "identifier": "^somesamplefootnote", + "label": "^somesamplefootnote", "referenceType": "shortcut", "children": [ { @@ -96,6 +97,7 @@ { "type": "linkReference", "identifier": "^somesamplefootnote", + "label": "^somesamplefootnote", "referenceType": "shortcut", "children": [ { @@ -185,6 +187,7 @@ { "type": "linkReference", "identifier": "paragraph", + "label": "paragraph", "referenceType": "shortcut", "children": [ { @@ -239,6 +242,7 @@ { "type": "linkReference", "identifier": "^documentdetails", + "label": "^documentdetails", "referenceType": "shortcut", "children": [ { @@ -311,6 +315,7 @@ { "type": "linkReference", "identifier": "^documentdetails", + "label": "^documentdetails", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/link-spaces.commonmark.json b/test/fixtures/tree/link-spaces.commonmark.json index 512bcb0e2..5ae7f57be 100644 --- a/test/fixtures/tree/link-spaces.commonmark.json +++ b/test/fixtures/tree/link-spaces.commonmark.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "alpha", + "label": "alpha", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/link-spaces.json b/test/fixtures/tree/link-spaces.json index 512bcb0e2..5ae7f57be 100644 --- a/test/fixtures/tree/link-spaces.json +++ b/test/fixtures/tree/link-spaces.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "alpha", + "label": "alpha", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/link-spaces.nogfm.commonmark.json b/test/fixtures/tree/link-spaces.nogfm.commonmark.json index 512bcb0e2..5ae7f57be 100644 --- a/test/fixtures/tree/link-spaces.nogfm.commonmark.json +++ b/test/fixtures/tree/link-spaces.nogfm.commonmark.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "alpha", + "label": "alpha", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/link-spaces.nogfm.json b/test/fixtures/tree/link-spaces.nogfm.json index 512bcb0e2..5ae7f57be 100644 --- a/test/fixtures/tree/link-spaces.nogfm.json +++ b/test/fixtures/tree/link-spaces.nogfm.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "alpha", + "label": "alpha", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/link-whitespace.commonmark.json b/test/fixtures/tree/link-whitespace.commonmark.json index 7efbde7ce..06c6ecd44 100644 --- a/test/fixtures/tree/link-whitespace.commonmark.json +++ b/test/fixtures/tree/link-whitespace.commonmark.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "alpha", + "label": "alpha", "referenceType": "shortcut", "children": [ { @@ -133,6 +134,7 @@ { "type": "linkReference", "identifier": "alpha", + "label": "alpha", "referenceType": "shortcut", "children": [ { @@ -259,6 +261,7 @@ { "type": "linkReference", "identifier": "alpha", + "label": "alpha", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/link-whitespace.json b/test/fixtures/tree/link-whitespace.json index 7efbde7ce..06c6ecd44 100644 --- a/test/fixtures/tree/link-whitespace.json +++ b/test/fixtures/tree/link-whitespace.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "alpha", + "label": "alpha", "referenceType": "shortcut", "children": [ { @@ -133,6 +134,7 @@ { "type": "linkReference", "identifier": "alpha", + "label": "alpha", "referenceType": "shortcut", "children": [ { @@ -259,6 +261,7 @@ { "type": "linkReference", "identifier": "alpha", + "label": "alpha", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-inline-style.commonmark.json b/test/fixtures/tree/links-inline-style.commonmark.json index c52e1282b..aa2584569 100644 --- a/test/fixtures/tree/links-inline-style.commonmark.json +++ b/test/fixtures/tree/links-inline-style.commonmark.json @@ -384,6 +384,7 @@ { "type": "linkReference", "identifier": "url and title", + "label": "URL and title", "referenceType": "shortcut", "children": [ { @@ -456,6 +457,7 @@ { "type": "linkReference", "identifier": "url and title", + "label": "URL and title", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-inline-style.json b/test/fixtures/tree/links-inline-style.json index c52e1282b..aa2584569 100644 --- a/test/fixtures/tree/links-inline-style.json +++ b/test/fixtures/tree/links-inline-style.json @@ -384,6 +384,7 @@ { "type": "linkReference", "identifier": "url and title", + "label": "URL and title", "referenceType": "shortcut", "children": [ { @@ -456,6 +457,7 @@ { "type": "linkReference", "identifier": "url and title", + "label": "URL and title", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-reference-proto.json b/test/fixtures/tree/links-reference-proto.json index b824fc1cb..406a2146a 100644 --- a/test/fixtures/tree/links-reference-proto.json +++ b/test/fixtures/tree/links-reference-proto.json @@ -24,6 +24,7 @@ { "type": "linkReference", "identifier": "tostring", + "label": "toString", "referenceType": "full", "children": [ { @@ -78,6 +79,7 @@ { "type": "linkReference", "identifier": "constructor", + "label": "constructor", "referenceType": "full", "children": [ { @@ -132,6 +134,7 @@ { "type": "linkReference", "identifier": "__proto__", + "label": "__proto__", "referenceType": "full", "children": [ { diff --git a/test/fixtures/tree/links-reference-style.json b/test/fixtures/tree/links-reference-style.json index 76fa50ce1..aea2583cc 100644 --- a/test/fixtures/tree/links-reference-style.json +++ b/test/fixtures/tree/links-reference-style.json @@ -24,6 +24,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "full", "children": [ { @@ -113,6 +114,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "full", "children": [ { @@ -202,6 +204,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "full", "children": [ { @@ -315,6 +318,7 @@ { "type": "linkReference", "identifier": "b", + "label": "b", "referenceType": "full", "children": [ { @@ -455,6 +459,7 @@ { "type": "linkReference", "identifier": "once", + "label": "once", "referenceType": "collapsed", "children": [ { @@ -544,6 +549,7 @@ { "type": "linkReference", "identifier": "twice", + "label": "twice", "referenceType": "collapsed", "children": [ { @@ -633,6 +639,7 @@ { "type": "linkReference", "identifier": "thrice", + "label": "thrice", "referenceType": "collapsed", "children": [ { @@ -722,6 +729,7 @@ { "type": "linkReference", "identifier": "four", + "label": "four", "referenceType": "collapsed", "children": [ { @@ -909,6 +917,7 @@ { "type": "linkReference", "identifier": "this", + "label": "this", "referenceType": "full", "children": [ { @@ -998,6 +1007,7 @@ { "type": "linkReference", "identifier": "this", + "label": "this", "referenceType": "full", "children": [ { @@ -1087,6 +1097,7 @@ { "type": "linkReference", "identifier": "this", + "label": "this", "referenceType": "collapsed", "children": [ { @@ -1176,6 +1187,7 @@ { "type": "linkReference", "identifier": "this", + "label": "this", "referenceType": "collapsed", "children": [ { @@ -1265,6 +1277,7 @@ { "type": "linkReference", "identifier": "this", + "label": "this", "referenceType": "shortcut", "children": [ { @@ -1354,6 +1367,7 @@ { "type": "linkReference", "identifier": "that", + "label": "that", "referenceType": "collapsed", "children": [ { @@ -1443,6 +1457,7 @@ { "type": "linkReference", "identifier": "that", + "label": "that", "referenceType": "collapsed", "children": [ { @@ -1532,6 +1547,7 @@ { "type": "linkReference", "identifier": "that", + "label": "that", "referenceType": "shortcut", "children": [ { @@ -1621,6 +1637,7 @@ { "type": "linkReference", "identifier": "this", + "label": "this", "referenceType": "collapsed", "children": [ { @@ -1710,6 +1727,7 @@ { "type": "linkReference", "identifier": "this", + "label": "this", "referenceType": "shortcut", "children": [ { @@ -2027,6 +2045,7 @@ { "type": "linkReference", "identifier": "link breaks", + "label": "link\nbreaks", "referenceType": "shortcut", "children": [ { @@ -2122,6 +2141,7 @@ { "type": "linkReference", "identifier": "link breaks", + "label": "link \nbreaks", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-shortcut-references.json b/test/fixtures/tree/links-shortcut-references.json index 02f440eee..46b6ba2a9 100644 --- a/test/fixtures/tree/links-shortcut-references.json +++ b/test/fixtures/tree/links-shortcut-references.json @@ -24,6 +24,7 @@ { "type": "linkReference", "identifier": "simple case", + "label": "simple case", "referenceType": "shortcut", "children": [ { @@ -133,6 +134,7 @@ { "type": "linkReference", "identifier": "line break", + "label": "line\nbreak", "referenceType": "shortcut", "children": [ { @@ -228,6 +230,7 @@ { "type": "linkReference", "identifier": "line break", + "label": "line \nbreak", "referenceType": "shortcut", "children": [ { @@ -326,6 +329,7 @@ { "type": "linkReference", "identifier": "that", + "label": "that", "referenceType": "full", "children": [ { @@ -380,6 +384,7 @@ { "type": "linkReference", "identifier": "other", + "label": "other", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-title-double-quotes-delimiters.commonmark.json b/test/fixtures/tree/links-title-double-quotes-delimiters.commonmark.json index 68ef6e519..0fa419177 100644 --- a/test/fixtures/tree/links-title-double-quotes-delimiters.commonmark.json +++ b/test/fixtures/tree/links-title-double-quotes-delimiters.commonmark.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -79,6 +80,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-title-double-quotes-mismatched-delimiters.commonmark.json b/test/fixtures/tree/links-title-double-quotes-mismatched-delimiters.commonmark.json index 3feeca14d..66137d074 100644 --- a/test/fixtures/tree/links-title-double-quotes-mismatched-delimiters.commonmark.json +++ b/test/fixtures/tree/links-title-double-quotes-mismatched-delimiters.commonmark.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -79,6 +80,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-title-empty-parentheses.json b/test/fixtures/tree/links-title-empty-parentheses.json index 0b8726827..af7ca1ef5 100644 --- a/test/fixtures/tree/links-title-empty-parentheses.json +++ b/test/fixtures/tree/links-title-empty-parentheses.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -79,6 +80,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-title-empty-parentheses.nogfm.json b/test/fixtures/tree/links-title-empty-parentheses.nogfm.json index 0b8726827..af7ca1ef5 100644 --- a/test/fixtures/tree/links-title-empty-parentheses.nogfm.json +++ b/test/fixtures/tree/links-title-empty-parentheses.nogfm.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -79,6 +80,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-title-parentheses.json b/test/fixtures/tree/links-title-parentheses.json index 74ab71800..8fc27352a 100644 --- a/test/fixtures/tree/links-title-parentheses.json +++ b/test/fixtures/tree/links-title-parentheses.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -79,6 +80,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-title-parentheses.nogfm.json b/test/fixtures/tree/links-title-parentheses.nogfm.json index 74ab71800..8fc27352a 100644 --- a/test/fixtures/tree/links-title-parentheses.nogfm.json +++ b/test/fixtures/tree/links-title-parentheses.nogfm.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -79,6 +80,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-title-single-quotes-delimiters.commonmark.json b/test/fixtures/tree/links-title-single-quotes-delimiters.commonmark.json index 021ab659f..9a5200cf0 100644 --- a/test/fixtures/tree/links-title-single-quotes-delimiters.commonmark.json +++ b/test/fixtures/tree/links-title-single-quotes-delimiters.commonmark.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -79,6 +80,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-title-single-quotes-mismatched-delimiters.commonmark.json b/test/fixtures/tree/links-title-single-quotes-mismatched-delimiters.commonmark.json index d6b9869aa..5c51b7f0b 100644 --- a/test/fixtures/tree/links-title-single-quotes-mismatched-delimiters.commonmark.json +++ b/test/fixtures/tree/links-title-single-quotes-mismatched-delimiters.commonmark.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -79,6 +80,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-title-unclosed.commonmark.json b/test/fixtures/tree/links-title-unclosed.commonmark.json index d0655eee6..29e4947a4 100644 --- a/test/fixtures/tree/links-title-unclosed.commonmark.json +++ b/test/fixtures/tree/links-title-unclosed.commonmark.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -79,6 +80,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -259,6 +261,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -331,6 +334,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -511,6 +515,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -583,6 +588,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-title-unclosed.json b/test/fixtures/tree/links-title-unclosed.json index d0655eee6..29e4947a4 100644 --- a/test/fixtures/tree/links-title-unclosed.json +++ b/test/fixtures/tree/links-title-unclosed.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -79,6 +80,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -259,6 +261,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -331,6 +334,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -511,6 +515,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -583,6 +588,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-title-unclosed.nogfm.json b/test/fixtures/tree/links-title-unclosed.nogfm.json index d0655eee6..29e4947a4 100644 --- a/test/fixtures/tree/links-title-unclosed.nogfm.json +++ b/test/fixtures/tree/links-title-unclosed.nogfm.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -79,6 +80,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -259,6 +261,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -331,6 +334,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -511,6 +515,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -583,6 +588,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-url-empty-title-parentheses.json b/test/fixtures/tree/links-url-empty-title-parentheses.json index 19aaa8018..40262f1e7 100644 --- a/test/fixtures/tree/links-url-empty-title-parentheses.json +++ b/test/fixtures/tree/links-url-empty-title-parentheses.json @@ -151,6 +151,7 @@ { "type": "linkReference", "identifier": "world", + "label": "World", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-url-empty-title-parentheses.nogfm.json b/test/fixtures/tree/links-url-empty-title-parentheses.nogfm.json index 19aaa8018..40262f1e7 100644 --- a/test/fixtures/tree/links-url-empty-title-parentheses.nogfm.json +++ b/test/fixtures/tree/links-url-empty-title-parentheses.nogfm.json @@ -151,6 +151,7 @@ { "type": "linkReference", "identifier": "world", + "label": "World", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-url-mismatched-parentheses.commonmark.json b/test/fixtures/tree/links-url-mismatched-parentheses.commonmark.json index 61386e4a7..9d4a25659 100644 --- a/test/fixtures/tree/links-url-mismatched-parentheses.commonmark.json +++ b/test/fixtures/tree/links-url-mismatched-parentheses.commonmark.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-url-mismatched-parentheses.json b/test/fixtures/tree/links-url-mismatched-parentheses.json index 61386e4a7..9d4a25659 100644 --- a/test/fixtures/tree/links-url-mismatched-parentheses.json +++ b/test/fixtures/tree/links-url-mismatched-parentheses.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-url-mismatched-parentheses.nogfm.json b/test/fixtures/tree/links-url-mismatched-parentheses.nogfm.json index 61386e4a7..9d4a25659 100644 --- a/test/fixtures/tree/links-url-mismatched-parentheses.nogfm.json +++ b/test/fixtures/tree/links-url-mismatched-parentheses.nogfm.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-url-new-line.commonmark.json b/test/fixtures/tree/links-url-new-line.commonmark.json index b8b27e149..2a6367f7a 100644 --- a/test/fixtures/tree/links-url-new-line.commonmark.json +++ b/test/fixtures/tree/links-url-new-line.commonmark.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -83,6 +84,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-url-new-line.json b/test/fixtures/tree/links-url-new-line.json index 4a4ce8d5a..08cb5cb49 100644 --- a/test/fixtures/tree/links-url-new-line.json +++ b/test/fixtures/tree/links-url-new-line.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-url-new-line.nogfm.json b/test/fixtures/tree/links-url-new-line.nogfm.json index 4a4ce8d5a..08cb5cb49 100644 --- a/test/fixtures/tree/links-url-new-line.nogfm.json +++ b/test/fixtures/tree/links-url-new-line.nogfm.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-url-unclosed.json b/test/fixtures/tree/links-url-unclosed.json index cc4aec658..686b4c440 100644 --- a/test/fixtures/tree/links-url-unclosed.json +++ b/test/fixtures/tree/links-url-unclosed.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -79,6 +80,7 @@ { "type": "linkReference", "identifier": "world", + "label": "World", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-url-white-space.commonmark.json b/test/fixtures/tree/links-url-white-space.commonmark.json index 444a0d2ae..20bc28895 100644 --- a/test/fixtures/tree/links-url-white-space.commonmark.json +++ b/test/fixtures/tree/links-url-white-space.commonmark.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-url-white-space.json b/test/fixtures/tree/links-url-white-space.json index 444a0d2ae..20bc28895 100644 --- a/test/fixtures/tree/links-url-white-space.json +++ b/test/fixtures/tree/links-url-white-space.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/links-url-white-space.nogfm.json b/test/fixtures/tree/links-url-white-space.nogfm.json index 444a0d2ae..20bc28895 100644 --- a/test/fixtures/tree/links-url-white-space.nogfm.json +++ b/test/fixtures/tree/links-url-white-space.nogfm.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/list-continuation.commonmark.footnotes.json b/test/fixtures/tree/list-continuation.commonmark.footnotes.json index 2ec7b0a85..17ea5c4ff 100644 --- a/test/fixtures/tree/list-continuation.commonmark.footnotes.json +++ b/test/fixtures/tree/list-continuation.commonmark.footnotes.json @@ -208,6 +208,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "collapsed", "children": [ { @@ -264,6 +265,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/list-continuation.commonmark.footnotes.pedantic.json b/test/fixtures/tree/list-continuation.commonmark.footnotes.pedantic.json index 258eacc0f..80699fe56 100644 --- a/test/fixtures/tree/list-continuation.commonmark.footnotes.pedantic.json +++ b/test/fixtures/tree/list-continuation.commonmark.footnotes.pedantic.json @@ -207,6 +207,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "collapsed", "children": [ { @@ -263,6 +264,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/list-continuation.commonmark.json b/test/fixtures/tree/list-continuation.commonmark.json index a356a694c..fb496b0a0 100644 --- a/test/fixtures/tree/list-continuation.commonmark.json +++ b/test/fixtures/tree/list-continuation.commonmark.json @@ -208,6 +208,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "collapsed", "children": [ { @@ -264,6 +265,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { @@ -420,6 +422,7 @@ { "type": "linkReference", "identifier": "^foo", + "label": "^foo", "referenceType": "shortcut", "children": [ { @@ -476,6 +479,7 @@ { "type": "linkReference", "identifier": "^foo", + "label": "^foo", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/list-continuation.commonmark.pedantic.json b/test/fixtures/tree/list-continuation.commonmark.pedantic.json index 83af5ec31..54003e013 100644 --- a/test/fixtures/tree/list-continuation.commonmark.pedantic.json +++ b/test/fixtures/tree/list-continuation.commonmark.pedantic.json @@ -207,6 +207,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "collapsed", "children": [ { @@ -263,6 +264,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { @@ -419,6 +421,7 @@ { "type": "linkReference", "identifier": "^foo", + "label": "^foo", "referenceType": "shortcut", "children": [ { @@ -475,6 +478,7 @@ { "type": "linkReference", "identifier": "^foo", + "label": "^foo", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/list-continuation.footnotes.json b/test/fixtures/tree/list-continuation.footnotes.json index 7f4da8df0..c4613b820 100644 --- a/test/fixtures/tree/list-continuation.footnotes.json +++ b/test/fixtures/tree/list-continuation.footnotes.json @@ -208,6 +208,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "collapsed", "children": [ { diff --git a/test/fixtures/tree/list-continuation.footnotes.pedantic.json b/test/fixtures/tree/list-continuation.footnotes.pedantic.json index ce041f245..6e05c24fe 100644 --- a/test/fixtures/tree/list-continuation.footnotes.pedantic.json +++ b/test/fixtures/tree/list-continuation.footnotes.pedantic.json @@ -207,6 +207,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "collapsed", "children": [ { diff --git a/test/fixtures/tree/list-continuation.json b/test/fixtures/tree/list-continuation.json index e314b61f1..cf4e5c7d6 100644 --- a/test/fixtures/tree/list-continuation.json +++ b/test/fixtures/tree/list-continuation.json @@ -208,6 +208,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "collapsed", "children": [ { @@ -324,6 +325,7 @@ { "type": "linkReference", "identifier": "^foo", + "label": "^foo", "referenceType": "full", "children": [ { diff --git a/test/fixtures/tree/list-continuation.nogfm.commonmark.footnotes.json b/test/fixtures/tree/list-continuation.nogfm.commonmark.footnotes.json index f70b0409c..e4fab2388 100644 --- a/test/fixtures/tree/list-continuation.nogfm.commonmark.footnotes.json +++ b/test/fixtures/tree/list-continuation.nogfm.commonmark.footnotes.json @@ -220,6 +220,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "collapsed", "children": [ { @@ -276,6 +277,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/list-continuation.nogfm.commonmark.footnotes.pedantic.json b/test/fixtures/tree/list-continuation.nogfm.commonmark.footnotes.pedantic.json index 505350414..9d17a0a44 100644 --- a/test/fixtures/tree/list-continuation.nogfm.commonmark.footnotes.pedantic.json +++ b/test/fixtures/tree/list-continuation.nogfm.commonmark.footnotes.pedantic.json @@ -211,6 +211,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "collapsed", "children": [ { @@ -267,6 +268,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/list-continuation.nogfm.commonmark.json b/test/fixtures/tree/list-continuation.nogfm.commonmark.json index 4756f20c5..979876373 100644 --- a/test/fixtures/tree/list-continuation.nogfm.commonmark.json +++ b/test/fixtures/tree/list-continuation.nogfm.commonmark.json @@ -220,6 +220,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "collapsed", "children": [ { @@ -276,6 +277,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { @@ -395,6 +397,7 @@ { "type": "linkReference", "identifier": "^foo", + "label": "^foo", "referenceType": "shortcut", "children": [ { @@ -451,6 +454,7 @@ { "type": "linkReference", "identifier": "^foo", + "label": "^foo", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/list-continuation.nogfm.commonmark.pedantic.json b/test/fixtures/tree/list-continuation.nogfm.commonmark.pedantic.json index 841d20d3e..c7eb9ff0c 100644 --- a/test/fixtures/tree/list-continuation.nogfm.commonmark.pedantic.json +++ b/test/fixtures/tree/list-continuation.nogfm.commonmark.pedantic.json @@ -211,6 +211,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "collapsed", "children": [ { @@ -267,6 +268,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { @@ -386,6 +388,7 @@ { "type": "linkReference", "identifier": "^foo", + "label": "^foo", "referenceType": "shortcut", "children": [ { @@ -442,6 +445,7 @@ { "type": "linkReference", "identifier": "^foo", + "label": "^foo", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/list-continuation.nogfm.footnotes.json b/test/fixtures/tree/list-continuation.nogfm.footnotes.json index 2597a0a2b..d52113467 100644 --- a/test/fixtures/tree/list-continuation.nogfm.footnotes.json +++ b/test/fixtures/tree/list-continuation.nogfm.footnotes.json @@ -220,6 +220,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "collapsed", "children": [ { diff --git a/test/fixtures/tree/list-continuation.nogfm.footnotes.pedantic.json b/test/fixtures/tree/list-continuation.nogfm.footnotes.pedantic.json index 291f4956e..6edebf801 100644 --- a/test/fixtures/tree/list-continuation.nogfm.footnotes.pedantic.json +++ b/test/fixtures/tree/list-continuation.nogfm.footnotes.pedantic.json @@ -211,6 +211,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "collapsed", "children": [ { diff --git a/test/fixtures/tree/list-continuation.nogfm.json b/test/fixtures/tree/list-continuation.nogfm.json index 9c764e70e..48faea0af 100644 --- a/test/fixtures/tree/list-continuation.nogfm.json +++ b/test/fixtures/tree/list-continuation.nogfm.json @@ -220,6 +220,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "collapsed", "children": [ { @@ -336,6 +337,7 @@ { "type": "linkReference", "identifier": "^foo", + "label": "^foo", "referenceType": "full", "children": [ { diff --git a/test/fixtures/tree/list-continuation.nogfm.pedantic.json b/test/fixtures/tree/list-continuation.nogfm.pedantic.json index 19be4ff84..f661481d7 100644 --- a/test/fixtures/tree/list-continuation.nogfm.pedantic.json +++ b/test/fixtures/tree/list-continuation.nogfm.pedantic.json @@ -211,6 +211,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "collapsed", "children": [ { @@ -327,6 +328,7 @@ { "type": "linkReference", "identifier": "^foo", + "label": "^foo", "referenceType": "full", "children": [ { diff --git a/test/fixtures/tree/list-continuation.pedantic.json b/test/fixtures/tree/list-continuation.pedantic.json index 8533858ca..42b227fd7 100644 --- a/test/fixtures/tree/list-continuation.pedantic.json +++ b/test/fixtures/tree/list-continuation.pedantic.json @@ -207,6 +207,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "collapsed", "children": [ { @@ -323,6 +324,7 @@ { "type": "linkReference", "identifier": "^foo", + "label": "^foo", "referenceType": "full", "children": [ { diff --git a/test/fixtures/tree/main.json b/test/fixtures/tree/main.json index e0e22d4b2..987360333 100644 --- a/test/fixtures/tree/main.json +++ b/test/fixtures/tree/main.json @@ -83,6 +83,7 @@ { "type": "linkReference", "identifier": "test", + "label": "test", "referenceType": "full", "children": [ { diff --git a/test/fixtures/tree/main.nogfm.json b/test/fixtures/tree/main.nogfm.json index e0e22d4b2..987360333 100644 --- a/test/fixtures/tree/main.nogfm.json +++ b/test/fixtures/tree/main.nogfm.json @@ -83,6 +83,7 @@ { "type": "linkReference", "identifier": "test", + "label": "test", "referenceType": "full", "children": [ { diff --git a/test/fixtures/tree/main.nogfm.pedantic.json b/test/fixtures/tree/main.nogfm.pedantic.json index 1fc6cb8e6..72fa4a913 100644 --- a/test/fixtures/tree/main.nogfm.pedantic.json +++ b/test/fixtures/tree/main.nogfm.pedantic.json @@ -83,6 +83,7 @@ { "type": "linkReference", "identifier": "test", + "label": "test", "referenceType": "full", "children": [ { diff --git a/test/fixtures/tree/main.pedantic.json b/test/fixtures/tree/main.pedantic.json index 1fc6cb8e6..72fa4a913 100644 --- a/test/fixtures/tree/main.pedantic.json +++ b/test/fixtures/tree/main.pedantic.json @@ -83,6 +83,7 @@ { "type": "linkReference", "identifier": "test", + "label": "test", "referenceType": "full", "children": [ { diff --git a/test/fixtures/tree/markdown-documentation-basics.json b/test/fixtures/tree/markdown-documentation-basics.json index 4536a7425..946689758 100644 --- a/test/fixtures/tree/markdown-documentation-basics.json +++ b/test/fixtures/tree/markdown-documentation-basics.json @@ -126,6 +126,7 @@ { "type": "linkReference", "identifier": "s", + "label": "s", "referenceType": "full", "children": [ { @@ -226,6 +227,7 @@ { "type": "linkReference", "identifier": "d", + "label": "d", "referenceType": "full", "children": [ { @@ -358,6 +360,7 @@ { "type": "linkReference", "identifier": "src", + "label": "src", "referenceType": "full", "children": [ { diff --git a/test/fixtures/tree/markdown-documentation-syntax.commonmark.json b/test/fixtures/tree/markdown-documentation-syntax.commonmark.json index cab0c1c09..a3ead366c 100644 --- a/test/fixtures/tree/markdown-documentation-syntax.commonmark.json +++ b/test/fixtures/tree/markdown-documentation-syntax.commonmark.json @@ -1706,6 +1706,7 @@ { "type": "linkReference", "identifier": "src", + "label": "src", "referenceType": "full", "children": [ { @@ -1907,6 +1908,7 @@ { "type": "linkReference", "identifier": "setext", + "label": "Setext", "referenceType": "shortcut", "children": [ { @@ -1961,6 +1963,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { @@ -2015,6 +2018,7 @@ { "type": "linkReference", "identifier": "atx", + "label": "atx", "referenceType": "shortcut", "children": [ { @@ -2069,6 +2073,7 @@ { "type": "linkReference", "identifier": "2", + "label": "2", "referenceType": "shortcut", "children": [ { @@ -2123,6 +2128,7 @@ { "type": "linkReference", "identifier": "textile", + "label": "Textile", "referenceType": "shortcut", "children": [ { @@ -2177,6 +2183,7 @@ { "type": "linkReference", "identifier": "3", + "label": "3", "referenceType": "shortcut", "children": [ { @@ -2231,6 +2238,7 @@ { "type": "linkReference", "identifier": "restructuredtext", + "label": "reStructuredText", "referenceType": "shortcut", "children": [ { @@ -2285,6 +2293,7 @@ { "type": "linkReference", "identifier": "4", + "label": "4", "referenceType": "shortcut", "children": [ { @@ -2341,6 +2350,7 @@ { "type": "linkReference", "identifier": "grutatext", + "label": "Grutatext", "referenceType": "shortcut", "children": [ { @@ -2395,6 +2405,7 @@ { "type": "linkReference", "identifier": "5", + "label": "5", "referenceType": "shortcut", "children": [ { @@ -2449,6 +2460,7 @@ { "type": "linkReference", "identifier": "ettext", + "label": "EtText", "referenceType": "shortcut", "children": [ { @@ -2503,6 +2515,7 @@ { "type": "linkReference", "identifier": "6", + "label": "6", "referenceType": "shortcut", "children": [ { @@ -5226,6 +5239,7 @@ { "type": "linkReference", "identifier": "bq", + "label": "bq", "referenceType": "full", "children": [ { @@ -5280,6 +5294,7 @@ { "type": "linkReference", "identifier": "l", + "label": "l", "referenceType": "full", "children": [ { @@ -5432,6 +5447,7 @@ { "type": "linkReference", "identifier": "setext", + "label": "Setext", "referenceType": "shortcut", "children": [ { @@ -5486,6 +5502,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { @@ -5540,6 +5557,7 @@ { "type": "linkReference", "identifier": "atx", + "label": "atx", "referenceType": "shortcut", "children": [ { @@ -5594,6 +5612,7 @@ { "type": "linkReference", "identifier": "2", + "label": "2", "referenceType": "shortcut", "children": [ { @@ -8912,6 +8931,7 @@ { "type": "linkReference", "identifier": "square brackets", + "label": "square brackets", "referenceType": "shortcut", "children": [ { @@ -10281,6 +10301,7 @@ { "type": "linkReference", "identifier": "daring fireball", + "label": "Daring Fireball", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/markdown-documentation-syntax.commonmark.pedantic.json b/test/fixtures/tree/markdown-documentation-syntax.commonmark.pedantic.json index cab0c1c09..a3ead366c 100644 --- a/test/fixtures/tree/markdown-documentation-syntax.commonmark.pedantic.json +++ b/test/fixtures/tree/markdown-documentation-syntax.commonmark.pedantic.json @@ -1706,6 +1706,7 @@ { "type": "linkReference", "identifier": "src", + "label": "src", "referenceType": "full", "children": [ { @@ -1907,6 +1908,7 @@ { "type": "linkReference", "identifier": "setext", + "label": "Setext", "referenceType": "shortcut", "children": [ { @@ -1961,6 +1963,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { @@ -2015,6 +2018,7 @@ { "type": "linkReference", "identifier": "atx", + "label": "atx", "referenceType": "shortcut", "children": [ { @@ -2069,6 +2073,7 @@ { "type": "linkReference", "identifier": "2", + "label": "2", "referenceType": "shortcut", "children": [ { @@ -2123,6 +2128,7 @@ { "type": "linkReference", "identifier": "textile", + "label": "Textile", "referenceType": "shortcut", "children": [ { @@ -2177,6 +2183,7 @@ { "type": "linkReference", "identifier": "3", + "label": "3", "referenceType": "shortcut", "children": [ { @@ -2231,6 +2238,7 @@ { "type": "linkReference", "identifier": "restructuredtext", + "label": "reStructuredText", "referenceType": "shortcut", "children": [ { @@ -2285,6 +2293,7 @@ { "type": "linkReference", "identifier": "4", + "label": "4", "referenceType": "shortcut", "children": [ { @@ -2341,6 +2350,7 @@ { "type": "linkReference", "identifier": "grutatext", + "label": "Grutatext", "referenceType": "shortcut", "children": [ { @@ -2395,6 +2405,7 @@ { "type": "linkReference", "identifier": "5", + "label": "5", "referenceType": "shortcut", "children": [ { @@ -2449,6 +2460,7 @@ { "type": "linkReference", "identifier": "ettext", + "label": "EtText", "referenceType": "shortcut", "children": [ { @@ -2503,6 +2515,7 @@ { "type": "linkReference", "identifier": "6", + "label": "6", "referenceType": "shortcut", "children": [ { @@ -5226,6 +5239,7 @@ { "type": "linkReference", "identifier": "bq", + "label": "bq", "referenceType": "full", "children": [ { @@ -5280,6 +5294,7 @@ { "type": "linkReference", "identifier": "l", + "label": "l", "referenceType": "full", "children": [ { @@ -5432,6 +5447,7 @@ { "type": "linkReference", "identifier": "setext", + "label": "Setext", "referenceType": "shortcut", "children": [ { @@ -5486,6 +5502,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { @@ -5540,6 +5557,7 @@ { "type": "linkReference", "identifier": "atx", + "label": "atx", "referenceType": "shortcut", "children": [ { @@ -5594,6 +5612,7 @@ { "type": "linkReference", "identifier": "2", + "label": "2", "referenceType": "shortcut", "children": [ { @@ -8912,6 +8931,7 @@ { "type": "linkReference", "identifier": "square brackets", + "label": "square brackets", "referenceType": "shortcut", "children": [ { @@ -10281,6 +10301,7 @@ { "type": "linkReference", "identifier": "daring fireball", + "label": "Daring Fireball", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/markdown-documentation-syntax.json b/test/fixtures/tree/markdown-documentation-syntax.json index 480356304..0324d32af 100644 --- a/test/fixtures/tree/markdown-documentation-syntax.json +++ b/test/fixtures/tree/markdown-documentation-syntax.json @@ -1706,6 +1706,7 @@ { "type": "linkReference", "identifier": "src", + "label": "src", "referenceType": "full", "children": [ { @@ -1907,6 +1908,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "full", "children": [ { @@ -1961,6 +1963,7 @@ { "type": "linkReference", "identifier": "2", + "label": "2", "referenceType": "full", "children": [ { @@ -2015,6 +2018,7 @@ { "type": "linkReference", "identifier": "3", + "label": "3", "referenceType": "full", "children": [ { @@ -2069,6 +2073,7 @@ { "type": "linkReference", "identifier": "4", + "label": "4", "referenceType": "full", "children": [ { @@ -2125,6 +2130,7 @@ { "type": "linkReference", "identifier": "5", + "label": "5", "referenceType": "full", "children": [ { @@ -2179,6 +2185,7 @@ { "type": "linkReference", "identifier": "6", + "label": "6", "referenceType": "full", "children": [ { @@ -4902,6 +4909,7 @@ { "type": "linkReference", "identifier": "bq", + "label": "bq", "referenceType": "full", "children": [ { @@ -4956,6 +4964,7 @@ { "type": "linkReference", "identifier": "l", + "label": "l", "referenceType": "full", "children": [ { @@ -5108,6 +5117,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "full", "children": [ { @@ -5162,6 +5172,7 @@ { "type": "linkReference", "identifier": "2", + "label": "2", "referenceType": "full", "children": [ { @@ -8480,6 +8491,7 @@ { "type": "linkReference", "identifier": "square brackets", + "label": "square brackets", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/markdown-documentation-syntax.nogfm.commonmark.json b/test/fixtures/tree/markdown-documentation-syntax.nogfm.commonmark.json index f65edac5a..e2701b3cf 100644 --- a/test/fixtures/tree/markdown-documentation-syntax.nogfm.commonmark.json +++ b/test/fixtures/tree/markdown-documentation-syntax.nogfm.commonmark.json @@ -1706,6 +1706,7 @@ { "type": "linkReference", "identifier": "src", + "label": "src", "referenceType": "full", "children": [ { @@ -1907,6 +1908,7 @@ { "type": "linkReference", "identifier": "setext", + "label": "Setext", "referenceType": "shortcut", "children": [ { @@ -1961,6 +1963,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { @@ -2015,6 +2018,7 @@ { "type": "linkReference", "identifier": "atx", + "label": "atx", "referenceType": "shortcut", "children": [ { @@ -2069,6 +2073,7 @@ { "type": "linkReference", "identifier": "2", + "label": "2", "referenceType": "shortcut", "children": [ { @@ -2123,6 +2128,7 @@ { "type": "linkReference", "identifier": "textile", + "label": "Textile", "referenceType": "shortcut", "children": [ { @@ -2177,6 +2183,7 @@ { "type": "linkReference", "identifier": "3", + "label": "3", "referenceType": "shortcut", "children": [ { @@ -2231,6 +2238,7 @@ { "type": "linkReference", "identifier": "restructuredtext", + "label": "reStructuredText", "referenceType": "shortcut", "children": [ { @@ -2285,6 +2293,7 @@ { "type": "linkReference", "identifier": "4", + "label": "4", "referenceType": "shortcut", "children": [ { @@ -2341,6 +2350,7 @@ { "type": "linkReference", "identifier": "grutatext", + "label": "Grutatext", "referenceType": "shortcut", "children": [ { @@ -2395,6 +2405,7 @@ { "type": "linkReference", "identifier": "5", + "label": "5", "referenceType": "shortcut", "children": [ { @@ -2449,6 +2460,7 @@ { "type": "linkReference", "identifier": "ettext", + "label": "EtText", "referenceType": "shortcut", "children": [ { @@ -2503,6 +2515,7 @@ { "type": "linkReference", "identifier": "6", + "label": "6", "referenceType": "shortcut", "children": [ { @@ -5226,6 +5239,7 @@ { "type": "linkReference", "identifier": "bq", + "label": "bq", "referenceType": "full", "children": [ { @@ -5280,6 +5294,7 @@ { "type": "linkReference", "identifier": "l", + "label": "l", "referenceType": "full", "children": [ { @@ -5432,6 +5447,7 @@ { "type": "linkReference", "identifier": "setext", + "label": "Setext", "referenceType": "shortcut", "children": [ { @@ -5486,6 +5502,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { @@ -5540,6 +5557,7 @@ { "type": "linkReference", "identifier": "atx", + "label": "atx", "referenceType": "shortcut", "children": [ { @@ -5594,6 +5612,7 @@ { "type": "linkReference", "identifier": "2", + "label": "2", "referenceType": "shortcut", "children": [ { @@ -8912,6 +8931,7 @@ { "type": "linkReference", "identifier": "square brackets", + "label": "square brackets", "referenceType": "shortcut", "children": [ { @@ -10281,6 +10301,7 @@ { "type": "linkReference", "identifier": "daring fireball", + "label": "Daring Fireball", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/markdown-documentation-syntax.nogfm.commonmark.pedantic.json b/test/fixtures/tree/markdown-documentation-syntax.nogfm.commonmark.pedantic.json index f65edac5a..e2701b3cf 100644 --- a/test/fixtures/tree/markdown-documentation-syntax.nogfm.commonmark.pedantic.json +++ b/test/fixtures/tree/markdown-documentation-syntax.nogfm.commonmark.pedantic.json @@ -1706,6 +1706,7 @@ { "type": "linkReference", "identifier": "src", + "label": "src", "referenceType": "full", "children": [ { @@ -1907,6 +1908,7 @@ { "type": "linkReference", "identifier": "setext", + "label": "Setext", "referenceType": "shortcut", "children": [ { @@ -1961,6 +1963,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { @@ -2015,6 +2018,7 @@ { "type": "linkReference", "identifier": "atx", + "label": "atx", "referenceType": "shortcut", "children": [ { @@ -2069,6 +2073,7 @@ { "type": "linkReference", "identifier": "2", + "label": "2", "referenceType": "shortcut", "children": [ { @@ -2123,6 +2128,7 @@ { "type": "linkReference", "identifier": "textile", + "label": "Textile", "referenceType": "shortcut", "children": [ { @@ -2177,6 +2183,7 @@ { "type": "linkReference", "identifier": "3", + "label": "3", "referenceType": "shortcut", "children": [ { @@ -2231,6 +2238,7 @@ { "type": "linkReference", "identifier": "restructuredtext", + "label": "reStructuredText", "referenceType": "shortcut", "children": [ { @@ -2285,6 +2293,7 @@ { "type": "linkReference", "identifier": "4", + "label": "4", "referenceType": "shortcut", "children": [ { @@ -2341,6 +2350,7 @@ { "type": "linkReference", "identifier": "grutatext", + "label": "Grutatext", "referenceType": "shortcut", "children": [ { @@ -2395,6 +2405,7 @@ { "type": "linkReference", "identifier": "5", + "label": "5", "referenceType": "shortcut", "children": [ { @@ -2449,6 +2460,7 @@ { "type": "linkReference", "identifier": "ettext", + "label": "EtText", "referenceType": "shortcut", "children": [ { @@ -2503,6 +2515,7 @@ { "type": "linkReference", "identifier": "6", + "label": "6", "referenceType": "shortcut", "children": [ { @@ -5226,6 +5239,7 @@ { "type": "linkReference", "identifier": "bq", + "label": "bq", "referenceType": "full", "children": [ { @@ -5280,6 +5294,7 @@ { "type": "linkReference", "identifier": "l", + "label": "l", "referenceType": "full", "children": [ { @@ -5432,6 +5447,7 @@ { "type": "linkReference", "identifier": "setext", + "label": "Setext", "referenceType": "shortcut", "children": [ { @@ -5486,6 +5502,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "shortcut", "children": [ { @@ -5540,6 +5557,7 @@ { "type": "linkReference", "identifier": "atx", + "label": "atx", "referenceType": "shortcut", "children": [ { @@ -5594,6 +5612,7 @@ { "type": "linkReference", "identifier": "2", + "label": "2", "referenceType": "shortcut", "children": [ { @@ -8912,6 +8931,7 @@ { "type": "linkReference", "identifier": "square brackets", + "label": "square brackets", "referenceType": "shortcut", "children": [ { @@ -10281,6 +10301,7 @@ { "type": "linkReference", "identifier": "daring fireball", + "label": "Daring Fireball", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/markdown-documentation-syntax.nogfm.json b/test/fixtures/tree/markdown-documentation-syntax.nogfm.json index 480356304..0324d32af 100644 --- a/test/fixtures/tree/markdown-documentation-syntax.nogfm.json +++ b/test/fixtures/tree/markdown-documentation-syntax.nogfm.json @@ -1706,6 +1706,7 @@ { "type": "linkReference", "identifier": "src", + "label": "src", "referenceType": "full", "children": [ { @@ -1907,6 +1908,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "full", "children": [ { @@ -1961,6 +1963,7 @@ { "type": "linkReference", "identifier": "2", + "label": "2", "referenceType": "full", "children": [ { @@ -2015,6 +2018,7 @@ { "type": "linkReference", "identifier": "3", + "label": "3", "referenceType": "full", "children": [ { @@ -2069,6 +2073,7 @@ { "type": "linkReference", "identifier": "4", + "label": "4", "referenceType": "full", "children": [ { @@ -2125,6 +2130,7 @@ { "type": "linkReference", "identifier": "5", + "label": "5", "referenceType": "full", "children": [ { @@ -2179,6 +2185,7 @@ { "type": "linkReference", "identifier": "6", + "label": "6", "referenceType": "full", "children": [ { @@ -4902,6 +4909,7 @@ { "type": "linkReference", "identifier": "bq", + "label": "bq", "referenceType": "full", "children": [ { @@ -4956,6 +4964,7 @@ { "type": "linkReference", "identifier": "l", + "label": "l", "referenceType": "full", "children": [ { @@ -5108,6 +5117,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "full", "children": [ { @@ -5162,6 +5172,7 @@ { "type": "linkReference", "identifier": "2", + "label": "2", "referenceType": "full", "children": [ { @@ -8480,6 +8491,7 @@ { "type": "linkReference", "identifier": "square brackets", + "label": "square brackets", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/markdown-documentation-syntax.nogfm.pedantic.json b/test/fixtures/tree/markdown-documentation-syntax.nogfm.pedantic.json index 480356304..0324d32af 100644 --- a/test/fixtures/tree/markdown-documentation-syntax.nogfm.pedantic.json +++ b/test/fixtures/tree/markdown-documentation-syntax.nogfm.pedantic.json @@ -1706,6 +1706,7 @@ { "type": "linkReference", "identifier": "src", + "label": "src", "referenceType": "full", "children": [ { @@ -1907,6 +1908,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "full", "children": [ { @@ -1961,6 +1963,7 @@ { "type": "linkReference", "identifier": "2", + "label": "2", "referenceType": "full", "children": [ { @@ -2015,6 +2018,7 @@ { "type": "linkReference", "identifier": "3", + "label": "3", "referenceType": "full", "children": [ { @@ -2069,6 +2073,7 @@ { "type": "linkReference", "identifier": "4", + "label": "4", "referenceType": "full", "children": [ { @@ -2125,6 +2130,7 @@ { "type": "linkReference", "identifier": "5", + "label": "5", "referenceType": "full", "children": [ { @@ -2179,6 +2185,7 @@ { "type": "linkReference", "identifier": "6", + "label": "6", "referenceType": "full", "children": [ { @@ -4902,6 +4909,7 @@ { "type": "linkReference", "identifier": "bq", + "label": "bq", "referenceType": "full", "children": [ { @@ -4956,6 +4964,7 @@ { "type": "linkReference", "identifier": "l", + "label": "l", "referenceType": "full", "children": [ { @@ -5108,6 +5117,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "full", "children": [ { @@ -5162,6 +5172,7 @@ { "type": "linkReference", "identifier": "2", + "label": "2", "referenceType": "full", "children": [ { @@ -8480,6 +8491,7 @@ { "type": "linkReference", "identifier": "square brackets", + "label": "square brackets", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/markdown-documentation-syntax.pedantic.json b/test/fixtures/tree/markdown-documentation-syntax.pedantic.json index 480356304..0324d32af 100644 --- a/test/fixtures/tree/markdown-documentation-syntax.pedantic.json +++ b/test/fixtures/tree/markdown-documentation-syntax.pedantic.json @@ -1706,6 +1706,7 @@ { "type": "linkReference", "identifier": "src", + "label": "src", "referenceType": "full", "children": [ { @@ -1907,6 +1908,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "full", "children": [ { @@ -1961,6 +1963,7 @@ { "type": "linkReference", "identifier": "2", + "label": "2", "referenceType": "full", "children": [ { @@ -2015,6 +2018,7 @@ { "type": "linkReference", "identifier": "3", + "label": "3", "referenceType": "full", "children": [ { @@ -2069,6 +2073,7 @@ { "type": "linkReference", "identifier": "4", + "label": "4", "referenceType": "full", "children": [ { @@ -2125,6 +2130,7 @@ { "type": "linkReference", "identifier": "5", + "label": "5", "referenceType": "full", "children": [ { @@ -2179,6 +2185,7 @@ { "type": "linkReference", "identifier": "6", + "label": "6", "referenceType": "full", "children": [ { @@ -4902,6 +4909,7 @@ { "type": "linkReference", "identifier": "bq", + "label": "bq", "referenceType": "full", "children": [ { @@ -4956,6 +4964,7 @@ { "type": "linkReference", "identifier": "l", + "label": "l", "referenceType": "full", "children": [ { @@ -5108,6 +5117,7 @@ { "type": "linkReference", "identifier": "1", + "label": "1", "referenceType": "full", "children": [ { @@ -5162,6 +5172,7 @@ { "type": "linkReference", "identifier": "2", + "label": "2", "referenceType": "full", "children": [ { @@ -8480,6 +8491,7 @@ { "type": "linkReference", "identifier": "square brackets", + "label": "square brackets", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/nested-references.commonmark.footnotes.json b/test/fixtures/tree/nested-references.commonmark.footnotes.json index 8d21428c0..8397c8126 100644 --- a/test/fixtures/tree/nested-references.commonmark.footnotes.json +++ b/test/fixtures/tree/nested-references.commonmark.footnotes.json @@ -42,6 +42,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "full", "children": [ { @@ -134,6 +135,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "full", "children": [ { @@ -224,6 +226,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "full", "children": [ { diff --git a/test/fixtures/tree/nested-references.commonmark.json b/test/fixtures/tree/nested-references.commonmark.json index cc74fa8b9..720f0ddd8 100644 --- a/test/fixtures/tree/nested-references.commonmark.json +++ b/test/fixtures/tree/nested-references.commonmark.json @@ -42,6 +42,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "full", "children": [ { @@ -134,6 +135,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "full", "children": [ { @@ -224,6 +226,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "full", "children": [ { @@ -319,6 +322,7 @@ { "type": "linkReference", "identifier": "^foo", + "label": "^foo", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/nested-references.footnotes.json b/test/fixtures/tree/nested-references.footnotes.json index 8d21428c0..8397c8126 100644 --- a/test/fixtures/tree/nested-references.footnotes.json +++ b/test/fixtures/tree/nested-references.footnotes.json @@ -42,6 +42,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "full", "children": [ { @@ -134,6 +135,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "full", "children": [ { @@ -224,6 +226,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "full", "children": [ { diff --git a/test/fixtures/tree/nested-references.json b/test/fixtures/tree/nested-references.json index cc74fa8b9..720f0ddd8 100644 --- a/test/fixtures/tree/nested-references.json +++ b/test/fixtures/tree/nested-references.json @@ -42,6 +42,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "full", "children": [ { @@ -134,6 +135,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "full", "children": [ { @@ -224,6 +226,7 @@ { "type": "linkReference", "identifier": "baz", + "label": "baz", "referenceType": "full", "children": [ { @@ -319,6 +322,7 @@ { "type": "linkReference", "identifier": "^foo", + "label": "^foo", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/nested-square-link.commonmark.json b/test/fixtures/tree/nested-square-link.commonmark.json index 3a9388b68..25a462c4f 100644 --- a/test/fixtures/tree/nested-square-link.commonmark.json +++ b/test/fixtures/tree/nested-square-link.commonmark.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "the `", + "label": "the `", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/nested-square-link.json b/test/fixtures/tree/nested-square-link.json index 3a9388b68..25a462c4f 100644 --- a/test/fixtures/tree/nested-square-link.json +++ b/test/fixtures/tree/nested-square-link.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "the `", + "label": "the `", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/ref-paren.json b/test/fixtures/tree/ref-paren.json index 0eb418363..c60f99e80 100644 --- a/test/fixtures/tree/ref-paren.json +++ b/test/fixtures/tree/ref-paren.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "hi", + "label": "hi", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/reference-link-escape.nooutput.json b/test/fixtures/tree/reference-link-escape.nooutput.json index 93dfc8554..8739c6841 100644 --- a/test/fixtures/tree/reference-link-escape.nooutput.json +++ b/test/fixtures/tree/reference-link-escape.nooutput.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "b\\-r", + "label": "b\\-r", "referenceType": "full", "children": [ { @@ -95,6 +96,7 @@ { "type": "linkReference", "identifier": "b\\*r*", + "label": "b\\*r*", "referenceType": "collapsed", "children": [ { @@ -183,6 +185,7 @@ { "type": "linkReference", "identifier": "b\\*r*", + "label": "b\\*r*", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/reference-link-not-closed.json b/test/fixtures/tree/reference-link-not-closed.json index 9b99a1997..4f6f09d13 100644 --- a/test/fixtures/tree/reference-link-not-closed.json +++ b/test/fixtures/tree/reference-link-not-closed.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "bar", + "label": "bar", "referenceType": "shortcut", "children": [ { @@ -79,6 +80,7 @@ { "type": "linkReference", "identifier": "bar", + "label": "bar", "referenceType": "shortcut", "children": [ { @@ -134,6 +136,7 @@ { "type": "linkReference", "identifier": "bar", + "label": "bar", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/reference-link-with-angle-brackets.json b/test/fixtures/tree/reference-link-with-angle-brackets.json index 04c60edfa..d66294db6 100644 --- a/test/fixtures/tree/reference-link-with-angle-brackets.json +++ b/test/fixtures/tree/reference-link-with-angle-brackets.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/reference-link-with-multiple-definitions.json b/test/fixtures/tree/reference-link-with-multiple-definitions.json index f6ed387bb..9c64fc6fe 100644 --- a/test/fixtures/tree/reference-link-with-multiple-definitions.json +++ b/test/fixtures/tree/reference-link-with-multiple-definitions.json @@ -7,6 +7,7 @@ { "type": "linkReference", "identifier": "foo", + "label": "foo", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/stringify-escape.commonmark.json b/test/fixtures/tree/stringify-escape.commonmark.json index a087d8c2f..6c5b91395 100644 --- a/test/fixtures/tree/stringify-escape.commonmark.json +++ b/test/fixtures/tree/stringify-escape.commonmark.json @@ -871,6 +871,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -995,6 +996,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -1521,6 +1523,7 @@ { "type": "linkReference", "identifier": "two*three", + "label": "two*three", "referenceType": "shortcut", "children": [ { @@ -1596,6 +1599,7 @@ { "type": "linkReference", "identifier": "two\\*three", + "label": "two\\*three", "referenceType": "shortcut", "children": [ { @@ -1705,6 +1709,7 @@ { "type": "linkReference", "identifier": "a\\a", + "label": "a\\a", "referenceType": "shortcut", "children": [ { @@ -1780,6 +1785,7 @@ { "type": "linkReference", "identifier": "a\\\\a", + "label": "a\\\\a", "referenceType": "shortcut", "children": [ { @@ -1889,6 +1895,7 @@ { "type": "linkReference", "identifier": "a\\\\\\a", + "label": "a\\\\\\a", "referenceType": "shortcut", "children": [ { @@ -1998,6 +2005,7 @@ { "type": "linkReference", "identifier": "a_a\\_a", + "label": "a_a\\_a", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/stringify-escape.commonmark.pedantic.json b/test/fixtures/tree/stringify-escape.commonmark.pedantic.json index b4fb1524d..0d2429f1d 100644 --- a/test/fixtures/tree/stringify-escape.commonmark.pedantic.json +++ b/test/fixtures/tree/stringify-escape.commonmark.pedantic.json @@ -977,6 +977,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -1101,6 +1102,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -1627,6 +1629,7 @@ { "type": "linkReference", "identifier": "two*three", + "label": "two*three", "referenceType": "shortcut", "children": [ { @@ -1702,6 +1705,7 @@ { "type": "linkReference", "identifier": "two\\*three", + "label": "two\\*three", "referenceType": "shortcut", "children": [ { @@ -1811,6 +1815,7 @@ { "type": "linkReference", "identifier": "a\\a", + "label": "a\\a", "referenceType": "shortcut", "children": [ { @@ -1886,6 +1891,7 @@ { "type": "linkReference", "identifier": "a\\\\a", + "label": "a\\\\a", "referenceType": "shortcut", "children": [ { @@ -1995,6 +2001,7 @@ { "type": "linkReference", "identifier": "a\\\\\\a", + "label": "a\\\\\\a", "referenceType": "shortcut", "children": [ { @@ -2104,6 +2111,7 @@ { "type": "linkReference", "identifier": "a_a\\_a", + "label": "a_a\\_a", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/stringify-escape.json b/test/fixtures/tree/stringify-escape.json index 8e88ebbbc..a01052538 100644 --- a/test/fixtures/tree/stringify-escape.json +++ b/test/fixtures/tree/stringify-escape.json @@ -871,6 +871,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -995,6 +996,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -1521,6 +1523,7 @@ { "type": "linkReference", "identifier": "two*three", + "label": "two*three", "referenceType": "shortcut", "children": [ { @@ -1596,6 +1599,7 @@ { "type": "linkReference", "identifier": "two\\*three", + "label": "two\\*three", "referenceType": "shortcut", "children": [ { @@ -1705,6 +1709,7 @@ { "type": "linkReference", "identifier": "a\\a", + "label": "a\\a", "referenceType": "shortcut", "children": [ { @@ -1780,6 +1785,7 @@ { "type": "linkReference", "identifier": "a\\\\a", + "label": "a\\\\a", "referenceType": "shortcut", "children": [ { @@ -1889,6 +1895,7 @@ { "type": "linkReference", "identifier": "a\\\\\\a", + "label": "a\\\\\\a", "referenceType": "shortcut", "children": [ { @@ -1998,6 +2005,7 @@ { "type": "linkReference", "identifier": "a_a\\_a", + "label": "a_a\\_a", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/stringify-escape.nogfm.commonmark.json b/test/fixtures/tree/stringify-escape.nogfm.commonmark.json index 557cf886f..be8488740 100644 --- a/test/fixtures/tree/stringify-escape.nogfm.commonmark.json +++ b/test/fixtures/tree/stringify-escape.nogfm.commonmark.json @@ -871,6 +871,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -995,6 +996,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -1521,6 +1523,7 @@ { "type": "linkReference", "identifier": "two*three", + "label": "two*three", "referenceType": "shortcut", "children": [ { @@ -1596,6 +1599,7 @@ { "type": "linkReference", "identifier": "two\\*three", + "label": "two\\*three", "referenceType": "shortcut", "children": [ { @@ -1705,6 +1709,7 @@ { "type": "linkReference", "identifier": "a\\a", + "label": "a\\a", "referenceType": "shortcut", "children": [ { @@ -1780,6 +1785,7 @@ { "type": "linkReference", "identifier": "a\\\\a", + "label": "a\\\\a", "referenceType": "shortcut", "children": [ { @@ -1889,6 +1895,7 @@ { "type": "linkReference", "identifier": "a\\\\\\a", + "label": "a\\\\\\a", "referenceType": "shortcut", "children": [ { @@ -1998,6 +2005,7 @@ { "type": "linkReference", "identifier": "a_a\\_a", + "label": "a_a\\_a", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/stringify-escape.nogfm.commonmark.pedantic.json b/test/fixtures/tree/stringify-escape.nogfm.commonmark.pedantic.json index 35266f214..79a348bad 100644 --- a/test/fixtures/tree/stringify-escape.nogfm.commonmark.pedantic.json +++ b/test/fixtures/tree/stringify-escape.nogfm.commonmark.pedantic.json @@ -977,6 +977,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -1101,6 +1102,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -1627,6 +1629,7 @@ { "type": "linkReference", "identifier": "two*three", + "label": "two*three", "referenceType": "shortcut", "children": [ { @@ -1702,6 +1705,7 @@ { "type": "linkReference", "identifier": "two\\*three", + "label": "two\\*three", "referenceType": "shortcut", "children": [ { @@ -1811,6 +1815,7 @@ { "type": "linkReference", "identifier": "a\\a", + "label": "a\\a", "referenceType": "shortcut", "children": [ { @@ -1886,6 +1891,7 @@ { "type": "linkReference", "identifier": "a\\\\a", + "label": "a\\\\a", "referenceType": "shortcut", "children": [ { @@ -1995,6 +2001,7 @@ { "type": "linkReference", "identifier": "a\\\\\\a", + "label": "a\\\\\\a", "referenceType": "shortcut", "children": [ { @@ -2104,6 +2111,7 @@ { "type": "linkReference", "identifier": "a_a\\_a", + "label": "a_a\\_a", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/stringify-escape.nogfm.json b/test/fixtures/tree/stringify-escape.nogfm.json index cccf17814..2376fa47a 100644 --- a/test/fixtures/tree/stringify-escape.nogfm.json +++ b/test/fixtures/tree/stringify-escape.nogfm.json @@ -871,6 +871,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -995,6 +996,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -1521,6 +1523,7 @@ { "type": "linkReference", "identifier": "two*three", + "label": "two*three", "referenceType": "shortcut", "children": [ { @@ -1596,6 +1599,7 @@ { "type": "linkReference", "identifier": "two\\*three", + "label": "two\\*three", "referenceType": "shortcut", "children": [ { @@ -1705,6 +1709,7 @@ { "type": "linkReference", "identifier": "a\\a", + "label": "a\\a", "referenceType": "shortcut", "children": [ { @@ -1780,6 +1785,7 @@ { "type": "linkReference", "identifier": "a\\\\a", + "label": "a\\\\a", "referenceType": "shortcut", "children": [ { @@ -1889,6 +1895,7 @@ { "type": "linkReference", "identifier": "a\\\\\\a", + "label": "a\\\\\\a", "referenceType": "shortcut", "children": [ { @@ -1998,6 +2005,7 @@ { "type": "linkReference", "identifier": "a_a\\_a", + "label": "a_a\\_a", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/stringify-escape.nogfm.pedantic.json b/test/fixtures/tree/stringify-escape.nogfm.pedantic.json index ce24196b0..841b3bfb3 100644 --- a/test/fixtures/tree/stringify-escape.nogfm.pedantic.json +++ b/test/fixtures/tree/stringify-escape.nogfm.pedantic.json @@ -977,6 +977,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -1101,6 +1102,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -1627,6 +1629,7 @@ { "type": "linkReference", "identifier": "two*three", + "label": "two*three", "referenceType": "shortcut", "children": [ { @@ -1702,6 +1705,7 @@ { "type": "linkReference", "identifier": "two\\*three", + "label": "two\\*three", "referenceType": "shortcut", "children": [ { @@ -1811,6 +1815,7 @@ { "type": "linkReference", "identifier": "a\\a", + "label": "a\\a", "referenceType": "shortcut", "children": [ { @@ -1886,6 +1891,7 @@ { "type": "linkReference", "identifier": "a\\\\a", + "label": "a\\\\a", "referenceType": "shortcut", "children": [ { @@ -1995,6 +2001,7 @@ { "type": "linkReference", "identifier": "a\\\\\\a", + "label": "a\\\\\\a", "referenceType": "shortcut", "children": [ { @@ -2104,6 +2111,7 @@ { "type": "linkReference", "identifier": "a_a\\_a", + "label": "a_a\\_a", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/stringify-escape.output.commonmark.commonmark.json b/test/fixtures/tree/stringify-escape.output.commonmark.commonmark.json index 5c179e318..0b962b900 100644 --- a/test/fixtures/tree/stringify-escape.output.commonmark.commonmark.json +++ b/test/fixtures/tree/stringify-escape.output.commonmark.commonmark.json @@ -674,6 +674,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -798,6 +799,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -1324,6 +1326,7 @@ { "type": "linkReference", "identifier": "two*three", + "label": "two*three", "referenceType": "shortcut", "children": [ { @@ -1399,6 +1402,7 @@ { "type": "linkReference", "identifier": "two\\*three", + "label": "two\\*three", "referenceType": "shortcut", "children": [ { @@ -1508,6 +1512,7 @@ { "type": "linkReference", "identifier": "a\\a", + "label": "a\\a", "referenceType": "shortcut", "children": [ { @@ -1583,6 +1588,7 @@ { "type": "linkReference", "identifier": "a\\\\a", + "label": "a\\\\a", "referenceType": "shortcut", "children": [ { @@ -1692,6 +1698,7 @@ { "type": "linkReference", "identifier": "a\\\\\\a", + "label": "a\\\\\\a", "referenceType": "shortcut", "children": [ { @@ -1801,6 +1808,7 @@ { "type": "linkReference", "identifier": "a_a\\_a", + "label": "a_a\\_a", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/stringify-escape.output.json b/test/fixtures/tree/stringify-escape.output.json index f6d7a8e05..3cfa1800f 100644 --- a/test/fixtures/tree/stringify-escape.output.json +++ b/test/fixtures/tree/stringify-escape.output.json @@ -674,6 +674,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -798,6 +799,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -1324,6 +1326,7 @@ { "type": "linkReference", "identifier": "two*three", + "label": "two*three", "referenceType": "shortcut", "children": [ { @@ -1399,6 +1402,7 @@ { "type": "linkReference", "identifier": "two\\*three", + "label": "two\\*three", "referenceType": "shortcut", "children": [ { @@ -1508,6 +1512,7 @@ { "type": "linkReference", "identifier": "a\\a", + "label": "a\\a", "referenceType": "shortcut", "children": [ { @@ -1583,6 +1588,7 @@ { "type": "linkReference", "identifier": "a\\\\a", + "label": "a\\\\a", "referenceType": "shortcut", "children": [ { @@ -1692,6 +1698,7 @@ { "type": "linkReference", "identifier": "a\\\\\\a", + "label": "a\\\\\\a", "referenceType": "shortcut", "children": [ { @@ -1801,6 +1808,7 @@ { "type": "linkReference", "identifier": "a_a\\_a", + "label": "a_a\\_a", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/stringify-escape.output.nogfm.commonmark.nogfm.commonmark.json b/test/fixtures/tree/stringify-escape.output.nogfm.commonmark.nogfm.commonmark.json index 32067fc62..d018c7adc 100644 --- a/test/fixtures/tree/stringify-escape.output.nogfm.commonmark.nogfm.commonmark.json +++ b/test/fixtures/tree/stringify-escape.output.nogfm.commonmark.nogfm.commonmark.json @@ -674,6 +674,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -798,6 +799,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -1324,6 +1326,7 @@ { "type": "linkReference", "identifier": "two*three", + "label": "two*three", "referenceType": "shortcut", "children": [ { @@ -1399,6 +1402,7 @@ { "type": "linkReference", "identifier": "two\\*three", + "label": "two\\*three", "referenceType": "shortcut", "children": [ { @@ -1508,6 +1512,7 @@ { "type": "linkReference", "identifier": "a\\a", + "label": "a\\a", "referenceType": "shortcut", "children": [ { @@ -1583,6 +1588,7 @@ { "type": "linkReference", "identifier": "a\\\\a", + "label": "a\\\\a", "referenceType": "shortcut", "children": [ { @@ -1692,6 +1698,7 @@ { "type": "linkReference", "identifier": "a\\\\\\a", + "label": "a\\\\\\a", "referenceType": "shortcut", "children": [ { @@ -1801,6 +1808,7 @@ { "type": "linkReference", "identifier": "a_a\\_a", + "label": "a_a\\_a", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/stringify-escape.output.nogfm.nogfm.json b/test/fixtures/tree/stringify-escape.output.nogfm.nogfm.json index d1ef7a332..4e24286d8 100644 --- a/test/fixtures/tree/stringify-escape.output.nogfm.nogfm.json +++ b/test/fixtures/tree/stringify-escape.output.nogfm.nogfm.json @@ -674,6 +674,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -798,6 +799,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -1324,6 +1326,7 @@ { "type": "linkReference", "identifier": "two*three", + "label": "two*three", "referenceType": "shortcut", "children": [ { @@ -1399,6 +1402,7 @@ { "type": "linkReference", "identifier": "two\\*three", + "label": "two\\*three", "referenceType": "shortcut", "children": [ { @@ -1508,6 +1512,7 @@ { "type": "linkReference", "identifier": "a\\a", + "label": "a\\a", "referenceType": "shortcut", "children": [ { @@ -1583,6 +1588,7 @@ { "type": "linkReference", "identifier": "a\\\\a", + "label": "a\\\\a", "referenceType": "shortcut", "children": [ { @@ -1692,6 +1698,7 @@ { "type": "linkReference", "identifier": "a\\\\\\a", + "label": "a\\\\\\a", "referenceType": "shortcut", "children": [ { @@ -1801,6 +1808,7 @@ { "type": "linkReference", "identifier": "a_a\\_a", + "label": "a_a\\_a", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/stringify-escape.output.noposition.pedantic.noposition.pedantic.json b/test/fixtures/tree/stringify-escape.output.noposition.pedantic.noposition.pedantic.json index c4d2dfed9..5cc07c6ab 100644 --- a/test/fixtures/tree/stringify-escape.output.noposition.pedantic.noposition.pedantic.json +++ b/test/fixtures/tree/stringify-escape.output.noposition.pedantic.noposition.pedantic.json @@ -226,6 +226,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -259,6 +260,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -397,6 +399,7 @@ { "type": "linkReference", "identifier": "two*three", + "label": "two*three", "referenceType": "shortcut", "children": [ { @@ -420,6 +423,7 @@ { "type": "linkReference", "identifier": "two\\*three", + "label": "two\\*three", "referenceType": "shortcut", "children": [ { @@ -451,6 +455,7 @@ { "type": "linkReference", "identifier": "a\\a", + "label": "a\\a", "referenceType": "shortcut", "children": [ { @@ -474,6 +479,7 @@ { "type": "linkReference", "identifier": "a\\\\a", + "label": "a\\\\a", "referenceType": "shortcut", "children": [ { @@ -505,6 +511,7 @@ { "type": "linkReference", "identifier": "a\\\\\\a", + "label": "a\\\\\\a", "referenceType": "shortcut", "children": [ { @@ -536,6 +543,7 @@ { "type": "linkReference", "identifier": "a_a\\_a", + "label": "a_a\\_a", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/stringify-escape.output.pedantic.pedantic.json b/test/fixtures/tree/stringify-escape.output.pedantic.pedantic.json index af2dbcd32..b836de42b 100644 --- a/test/fixtures/tree/stringify-escape.output.pedantic.pedantic.json +++ b/test/fixtures/tree/stringify-escape.output.pedantic.pedantic.json @@ -878,6 +878,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -1002,6 +1003,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -1528,6 +1530,7 @@ { "type": "linkReference", "identifier": "two*three", + "label": "two*three", "referenceType": "shortcut", "children": [ { @@ -1603,6 +1606,7 @@ { "type": "linkReference", "identifier": "two\\*three", + "label": "two\\*three", "referenceType": "shortcut", "children": [ { @@ -1712,6 +1716,7 @@ { "type": "linkReference", "identifier": "a\\a", + "label": "a\\a", "referenceType": "shortcut", "children": [ { @@ -1787,6 +1792,7 @@ { "type": "linkReference", "identifier": "a\\\\a", + "label": "a\\\\a", "referenceType": "shortcut", "children": [ { @@ -1896,6 +1902,7 @@ { "type": "linkReference", "identifier": "a\\\\\\a", + "label": "a\\\\\\a", "referenceType": "shortcut", "children": [ { @@ -2005,6 +2012,7 @@ { "type": "linkReference", "identifier": "a_a\\_a", + "label": "a_a\\_a", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/stringify-escape.pedantic.json b/test/fixtures/tree/stringify-escape.pedantic.json index bdf1ffef1..a97837c96 100644 --- a/test/fixtures/tree/stringify-escape.pedantic.json +++ b/test/fixtures/tree/stringify-escape.pedantic.json @@ -977,6 +977,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -1101,6 +1102,7 @@ { "type": "linkReference", "identifier": "ref", + "label": "ref", "referenceType": "shortcut", "children": [ { @@ -1627,6 +1629,7 @@ { "type": "linkReference", "identifier": "two*three", + "label": "two*three", "referenceType": "shortcut", "children": [ { @@ -1702,6 +1705,7 @@ { "type": "linkReference", "identifier": "two\\*three", + "label": "two\\*three", "referenceType": "shortcut", "children": [ { @@ -1811,6 +1815,7 @@ { "type": "linkReference", "identifier": "a\\a", + "label": "a\\a", "referenceType": "shortcut", "children": [ { @@ -1886,6 +1891,7 @@ { "type": "linkReference", "identifier": "a\\\\a", + "label": "a\\\\a", "referenceType": "shortcut", "children": [ { @@ -1995,6 +2001,7 @@ { "type": "linkReference", "identifier": "a\\\\\\a", + "label": "a\\\\\\a", "referenceType": "shortcut", "children": [ { @@ -2104,6 +2111,7 @@ { "type": "linkReference", "identifier": "a_a\\_a", + "label": "a_a\\_a", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/task-list-ordered.nogfm.json b/test/fixtures/tree/task-list-ordered.nogfm.json index 1595e5bc4..57816b105 100644 --- a/test/fixtures/tree/task-list-ordered.nogfm.json +++ b/test/fixtures/tree/task-list-ordered.nogfm.json @@ -18,6 +18,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -165,6 +166,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -248,6 +250,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -372,6 +375,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/task-list-ordered.nogfm.pedantic.json b/test/fixtures/tree/task-list-ordered.nogfm.pedantic.json index 1595e5bc4..57816b105 100644 --- a/test/fixtures/tree/task-list-ordered.nogfm.pedantic.json +++ b/test/fixtures/tree/task-list-ordered.nogfm.pedantic.json @@ -18,6 +18,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -165,6 +166,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -248,6 +250,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -372,6 +375,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/task-list-unordered-asterisk.nogfm.json b/test/fixtures/tree/task-list-unordered-asterisk.nogfm.json index 78212d025..3bfbdeaee 100644 --- a/test/fixtures/tree/task-list-unordered-asterisk.nogfm.json +++ b/test/fixtures/tree/task-list-unordered-asterisk.nogfm.json @@ -18,6 +18,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -165,6 +166,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -248,6 +250,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -372,6 +375,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/task-list-unordered-asterisk.nogfm.pedantic.json b/test/fixtures/tree/task-list-unordered-asterisk.nogfm.pedantic.json index 2859b0111..5f8d672e9 100644 --- a/test/fixtures/tree/task-list-unordered-asterisk.nogfm.pedantic.json +++ b/test/fixtures/tree/task-list-unordered-asterisk.nogfm.pedantic.json @@ -18,6 +18,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -165,6 +166,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -248,6 +250,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -372,6 +375,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/task-list-unordered-dash.nogfm.json b/test/fixtures/tree/task-list-unordered-dash.nogfm.json index 78212d025..3bfbdeaee 100644 --- a/test/fixtures/tree/task-list-unordered-dash.nogfm.json +++ b/test/fixtures/tree/task-list-unordered-dash.nogfm.json @@ -18,6 +18,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -165,6 +166,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -248,6 +250,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -372,6 +375,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/task-list-unordered-dash.nogfm.pedantic.json b/test/fixtures/tree/task-list-unordered-dash.nogfm.pedantic.json index 2859b0111..5f8d672e9 100644 --- a/test/fixtures/tree/task-list-unordered-dash.nogfm.pedantic.json +++ b/test/fixtures/tree/task-list-unordered-dash.nogfm.pedantic.json @@ -18,6 +18,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -165,6 +166,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -248,6 +250,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -372,6 +375,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/task-list-unordered-plus.nogfm.json b/test/fixtures/tree/task-list-unordered-plus.nogfm.json index 78212d025..3bfbdeaee 100644 --- a/test/fixtures/tree/task-list-unordered-plus.nogfm.json +++ b/test/fixtures/tree/task-list-unordered-plus.nogfm.json @@ -18,6 +18,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -165,6 +166,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -248,6 +250,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -372,6 +375,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/task-list-unordered-plus.nogfm.pedantic.json b/test/fixtures/tree/task-list-unordered-plus.nogfm.pedantic.json index 2859b0111..5f8d672e9 100644 --- a/test/fixtures/tree/task-list-unordered-plus.nogfm.pedantic.json +++ b/test/fixtures/tree/task-list-unordered-plus.nogfm.pedantic.json @@ -18,6 +18,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -165,6 +166,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -248,6 +250,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -372,6 +375,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/task-list.commonmark.json b/test/fixtures/tree/task-list.commonmark.json index 0c58299e7..4cda9e79e 100644 --- a/test/fixtures/tree/task-list.commonmark.json +++ b/test/fixtures/tree/task-list.commonmark.json @@ -56,6 +56,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -131,6 +132,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -229,6 +231,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -304,6 +307,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -760,6 +764,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -852,6 +857,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -967,6 +973,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -1059,6 +1066,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -2683,6 +2691,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\n", "referenceType": "shortcut", "children": [ { @@ -2806,6 +2815,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\n", "referenceType": "shortcut", "children": [ { @@ -2967,6 +2977,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -3080,6 +3091,7 @@ { "type": "linkReference", "identifier": " ", + "label": " \n", "referenceType": "shortcut", "children": [ { @@ -3180,6 +3192,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t\t", "referenceType": "shortcut", "children": [ { @@ -3272,6 +3285,7 @@ { "type": "linkReference", "identifier": " ", + "label": " \t ", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/task-list.json b/test/fixtures/tree/task-list.json index 0c58299e7..4cda9e79e 100644 --- a/test/fixtures/tree/task-list.json +++ b/test/fixtures/tree/task-list.json @@ -56,6 +56,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -131,6 +132,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -229,6 +231,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -304,6 +307,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -760,6 +764,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -852,6 +857,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -967,6 +973,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -1059,6 +1066,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -2683,6 +2691,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\n", "referenceType": "shortcut", "children": [ { @@ -2806,6 +2815,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\n", "referenceType": "shortcut", "children": [ { @@ -2967,6 +2977,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -3080,6 +3091,7 @@ { "type": "linkReference", "identifier": " ", + "label": " \n", "referenceType": "shortcut", "children": [ { @@ -3180,6 +3192,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t\t", "referenceType": "shortcut", "children": [ { @@ -3272,6 +3285,7 @@ { "type": "linkReference", "identifier": " ", + "label": " \t ", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/task-list.nogfm.commonmark.json b/test/fixtures/tree/task-list.nogfm.commonmark.json index 594803b30..e2435223d 100644 --- a/test/fixtures/tree/task-list.nogfm.commonmark.json +++ b/test/fixtures/tree/task-list.nogfm.commonmark.json @@ -56,6 +56,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -131,6 +132,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -229,6 +231,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -304,6 +307,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -440,6 +444,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -532,6 +537,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -647,6 +653,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -739,6 +746,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -892,6 +900,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -984,6 +993,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -1099,6 +1109,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -1191,6 +1202,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -1344,6 +1356,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -1436,6 +1449,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -1551,6 +1565,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -1643,6 +1658,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -1796,6 +1812,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -1888,6 +1905,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -2003,6 +2021,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -2095,6 +2114,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -2248,6 +2268,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -2340,6 +2361,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -2455,6 +2477,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -2547,6 +2570,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -2700,6 +2724,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -2792,6 +2817,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -2907,6 +2933,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -2999,6 +3026,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -3152,6 +3180,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -3244,6 +3273,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -3359,6 +3389,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -3451,6 +3482,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -3604,6 +3636,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -3717,6 +3750,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -3830,6 +3864,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -3922,6 +3957,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -4037,6 +4073,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -4188,6 +4225,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\n", "referenceType": "shortcut", "children": [ { @@ -4311,6 +4349,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\n", "referenceType": "shortcut", "children": [ { @@ -4472,6 +4511,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -4585,6 +4625,7 @@ { "type": "linkReference", "identifier": " ", + "label": " \n", "referenceType": "shortcut", "children": [ { @@ -4685,6 +4726,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t\t", "referenceType": "shortcut", "children": [ { @@ -4777,6 +4819,7 @@ { "type": "linkReference", "identifier": " ", + "label": " \t ", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/task-list.nogfm.json b/test/fixtures/tree/task-list.nogfm.json index 594803b30..e2435223d 100644 --- a/test/fixtures/tree/task-list.nogfm.json +++ b/test/fixtures/tree/task-list.nogfm.json @@ -56,6 +56,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -131,6 +132,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -229,6 +231,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -304,6 +307,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -440,6 +444,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -532,6 +537,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -647,6 +653,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -739,6 +746,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -892,6 +900,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -984,6 +993,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -1099,6 +1109,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -1191,6 +1202,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -1344,6 +1356,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -1436,6 +1449,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -1551,6 +1565,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -1643,6 +1658,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -1796,6 +1812,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -1888,6 +1905,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -2003,6 +2021,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -2095,6 +2114,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -2248,6 +2268,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -2340,6 +2361,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -2455,6 +2477,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -2547,6 +2570,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -2700,6 +2724,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -2792,6 +2817,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -2907,6 +2933,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -2999,6 +3026,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -3152,6 +3180,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -3244,6 +3273,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -3359,6 +3389,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -3451,6 +3482,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -3604,6 +3636,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -3717,6 +3750,7 @@ { "type": "linkReference", "identifier": "x", + "label": "x", "referenceType": "shortcut", "children": [ { @@ -3830,6 +3864,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t", "referenceType": "shortcut", "children": [ { @@ -3922,6 +3957,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -4037,6 +4073,7 @@ { "type": "linkReference", "identifier": "x", + "label": "X", "referenceType": "shortcut", "children": [ { @@ -4188,6 +4225,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\n", "referenceType": "shortcut", "children": [ { @@ -4311,6 +4349,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\n", "referenceType": "shortcut", "children": [ { @@ -4472,6 +4511,7 @@ { "type": "linkReference", "identifier": " ", + "label": " ", "referenceType": "shortcut", "children": [ { @@ -4585,6 +4625,7 @@ { "type": "linkReference", "identifier": " ", + "label": " \n", "referenceType": "shortcut", "children": [ { @@ -4685,6 +4726,7 @@ { "type": "linkReference", "identifier": " ", + "label": "\t\t", "referenceType": "shortcut", "children": [ { @@ -4777,6 +4819,7 @@ { "type": "linkReference", "identifier": " ", + "label": " \t ", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/title-attributes.commonmark.json b/test/fixtures/tree/title-attributes.commonmark.json index 2115e5a7c..3cb64e8e9 100644 --- a/test/fixtures/tree/title-attributes.commonmark.json +++ b/test/fixtures/tree/title-attributes.commonmark.json @@ -2802,6 +2802,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -2874,6 +2875,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -3202,6 +3204,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -3274,6 +3277,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/title-attributes.json b/test/fixtures/tree/title-attributes.json index 9e8943034..863e28932 100644 --- a/test/fixtures/tree/title-attributes.json +++ b/test/fixtures/tree/title-attributes.json @@ -3479,6 +3479,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -3551,6 +3552,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -3623,6 +3625,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -3695,6 +3698,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -3835,6 +3839,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -3975,6 +3980,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/title-attributes.nogfm.commonmark.json b/test/fixtures/tree/title-attributes.nogfm.commonmark.json index fa2024b95..c56d055ab 100644 --- a/test/fixtures/tree/title-attributes.nogfm.commonmark.json +++ b/test/fixtures/tree/title-attributes.nogfm.commonmark.json @@ -505,6 +505,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -577,6 +578,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -905,6 +907,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -977,6 +980,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/title-attributes.nogfm.json b/test/fixtures/tree/title-attributes.nogfm.json index c4d4e08fa..c8fa613a0 100644 --- a/test/fixtures/tree/title-attributes.nogfm.json +++ b/test/fixtures/tree/title-attributes.nogfm.json @@ -1182,6 +1182,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -1254,6 +1255,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -1326,6 +1328,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -1398,6 +1401,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -1538,6 +1542,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { @@ -1678,6 +1683,7 @@ { "type": "linkReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/toplevel-paragraphs.commonmark.json b/test/fixtures/tree/toplevel-paragraphs.commonmark.json index 714d729f1..4395cfc6b 100644 --- a/test/fixtures/tree/toplevel-paragraphs.commonmark.json +++ b/test/fixtures/tree/toplevel-paragraphs.commonmark.json @@ -626,6 +626,7 @@ { "type": "linkReference", "identifier": "how", + "label": "how", "referenceType": "full", "children": [ { @@ -682,6 +683,7 @@ { "type": "linkReference", "identifier": "how", + "label": "how", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/toplevel-paragraphs.json b/test/fixtures/tree/toplevel-paragraphs.json index d8a34d786..65f85187a 100644 --- a/test/fixtures/tree/toplevel-paragraphs.json +++ b/test/fixtures/tree/toplevel-paragraphs.json @@ -658,6 +658,7 @@ { "type": "linkReference", "identifier": "how", + "label": "how", "referenceType": "full", "children": [ { diff --git a/test/fixtures/tree/toplevel-paragraphs.nogfm.commonmark.json b/test/fixtures/tree/toplevel-paragraphs.nogfm.commonmark.json index a3ec8a571..6c7f13357 100644 --- a/test/fixtures/tree/toplevel-paragraphs.nogfm.commonmark.json +++ b/test/fixtures/tree/toplevel-paragraphs.nogfm.commonmark.json @@ -630,6 +630,7 @@ { "type": "linkReference", "identifier": "how", + "label": "how", "referenceType": "full", "children": [ { @@ -686,6 +687,7 @@ { "type": "linkReference", "identifier": "how", + "label": "how", "referenceType": "shortcut", "children": [ { diff --git a/test/fixtures/tree/toplevel-paragraphs.nogfm.json b/test/fixtures/tree/toplevel-paragraphs.nogfm.json index 94edc1e77..5133d68c2 100644 --- a/test/fixtures/tree/toplevel-paragraphs.nogfm.json +++ b/test/fixtures/tree/toplevel-paragraphs.nogfm.json @@ -590,6 +590,7 @@ { "type": "linkReference", "identifier": "how", + "label": "how", "referenceType": "full", "children": [ { From a90adaca541b57d7da9390060fb7dc25ab33aa62 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Sat, 6 Oct 2018 11:05:58 +0200 Subject: [PATCH 4/7] remark-parse: add label to image reference --- packages/remark-parse/lib/tokenize/reference.js | 5 +---- test/fixtures/tree/entities-advanced.commonmark.json | 1 + .../tree/entities-advanced.commonmark.pedantic.json | 1 + test/fixtures/tree/entities-advanced.json | 1 + test/fixtures/tree/entities-advanced.nogfm.commonmark.json | 1 + .../tree/entities-advanced.nogfm.commonmark.pedantic.json | 1 + test/fixtures/tree/entities-advanced.nogfm.json | 1 + test/fixtures/tree/entities-advanced.nogfm.pedantic.json | 1 + test/fixtures/tree/entities-advanced.pedantic.json | 1 + test/fixtures/tree/entities.output.entities.json | 3 +++ test/fixtures/tree/entities.output.entities=escape.json | 3 +++ test/fixtures/tree/entities.output.entities=numbers.json | 3 +++ test/fixtures/tree/entities.output.noentities.json | 3 +++ test/fixtures/tree/footnote-without-space.json | 1 + test/fixtures/tree/link-spaces.commonmark.json | 1 + test/fixtures/tree/link-spaces.json | 1 + test/fixtures/tree/link-spaces.nogfm.commonmark.json | 1 + test/fixtures/tree/link-spaces.nogfm.json | 1 + test/fixtures/tree/link-whitespace.commonmark.json | 3 +++ test/fixtures/tree/link-whitespace.json | 3 +++ .../links-title-double-quotes-delimiters.commonmark.json | 2 ++ ...itle-double-quotes-mismatched-delimiters.commonmark.json | 2 ++ test/fixtures/tree/links-title-empty-parentheses.json | 2 ++ test/fixtures/tree/links-title-empty-parentheses.nogfm.json | 2 ++ test/fixtures/tree/links-title-parentheses.json | 2 ++ test/fixtures/tree/links-title-parentheses.nogfm.json | 2 ++ .../links-title-single-quotes-delimiters.commonmark.json | 2 ++ ...itle-single-quotes-mismatched-delimiters.commonmark.json | 2 ++ test/fixtures/tree/links-title-unclosed.commonmark.json | 6 ++++++ test/fixtures/tree/links-title-unclosed.json | 6 ++++++ test/fixtures/tree/links-title-unclosed.nogfm.json | 6 ++++++ test/fixtures/tree/links-url-empty-title-parentheses.json | 1 + .../tree/links-url-empty-title-parentheses.nogfm.json | 1 + .../tree/links-url-mismatched-parentheses.commonmark.json | 1 + test/fixtures/tree/links-url-mismatched-parentheses.json | 1 + .../tree/links-url-mismatched-parentheses.nogfm.json | 1 + test/fixtures/tree/links-url-new-line.commonmark.json | 2 ++ test/fixtures/tree/links-url-new-line.json | 1 + test/fixtures/tree/links-url-new-line.nogfm.json | 1 + test/fixtures/tree/links-url-unclosed.json | 2 ++ test/fixtures/tree/links-url-white-space.commonmark.json | 1 + test/fixtures/tree/links-url-white-space.json | 1 + test/fixtures/tree/links-url-white-space.nogfm.json | 1 + .../tree/nested-references.commonmark.footnotes.json | 1 + test/fixtures/tree/nested-references.commonmark.json | 1 + test/fixtures/tree/nested-references.footnotes.json | 1 + test/fixtures/tree/nested-references.json | 1 + test/fixtures/tree/reference-image-empty-alt.json | 1 + test/fixtures/tree/reference-link-escape.nooutput.json | 3 +++ test/fixtures/tree/title-attributes.commonmark.json | 4 ++++ test/fixtures/tree/title-attributes.json | 6 ++++++ test/fixtures/tree/title-attributes.nogfm.commonmark.json | 4 ++++ test/fixtures/tree/title-attributes.nogfm.json | 6 ++++++ 53 files changed, 108 insertions(+), 4 deletions(-) diff --git a/packages/remark-parse/lib/tokenize/reference.js b/packages/remark-parse/lib/tokenize/reference.js index 30f482d98..572069ef4 100644 --- a/packages/remark-parse/lib/tokenize/reference.js +++ b/packages/remark-parse/lib/tokenize/reference.js @@ -196,11 +196,8 @@ function reference(eat, value, silent) { identifier: normalize(identifier) }; - if (type === T_LINK) { - node.label = identifier; - } - if (type === T_LINK || type === T_IMAGE) { + node.label = identifier; node.referenceType = referenceType; } diff --git a/test/fixtures/tree/entities-advanced.commonmark.json b/test/fixtures/tree/entities-advanced.commonmark.json index 3973b342f..229c4ef3f 100644 --- a/test/fixtures/tree/entities-advanced.commonmark.json +++ b/test/fixtures/tree/entities-advanced.commonmark.json @@ -885,6 +885,7 @@ { "type": "imageReference", "identifier": "12", + "label": "12", "referenceType": "full", "alt": "\n l©nks\n", "position": { diff --git a/test/fixtures/tree/entities-advanced.commonmark.pedantic.json b/test/fixtures/tree/entities-advanced.commonmark.pedantic.json index 3973b342f..229c4ef3f 100644 --- a/test/fixtures/tree/entities-advanced.commonmark.pedantic.json +++ b/test/fixtures/tree/entities-advanced.commonmark.pedantic.json @@ -885,6 +885,7 @@ { "type": "imageReference", "identifier": "12", + "label": "12", "referenceType": "full", "alt": "\n l©nks\n", "position": { diff --git a/test/fixtures/tree/entities-advanced.json b/test/fixtures/tree/entities-advanced.json index 1abaaca0d..855357f39 100644 --- a/test/fixtures/tree/entities-advanced.json +++ b/test/fixtures/tree/entities-advanced.json @@ -749,6 +749,7 @@ { "type": "imageReference", "identifier": "12", + "label": "12", "referenceType": "full", "alt": "\n l©nks\n", "position": { diff --git a/test/fixtures/tree/entities-advanced.nogfm.commonmark.json b/test/fixtures/tree/entities-advanced.nogfm.commonmark.json index 223460a2b..2a5c515d5 100644 --- a/test/fixtures/tree/entities-advanced.nogfm.commonmark.json +++ b/test/fixtures/tree/entities-advanced.nogfm.commonmark.json @@ -850,6 +850,7 @@ { "type": "imageReference", "identifier": "12", + "label": "12", "referenceType": "full", "alt": "\n l©nks\n", "position": { diff --git a/test/fixtures/tree/entities-advanced.nogfm.commonmark.pedantic.json b/test/fixtures/tree/entities-advanced.nogfm.commonmark.pedantic.json index 223460a2b..2a5c515d5 100644 --- a/test/fixtures/tree/entities-advanced.nogfm.commonmark.pedantic.json +++ b/test/fixtures/tree/entities-advanced.nogfm.commonmark.pedantic.json @@ -850,6 +850,7 @@ { "type": "imageReference", "identifier": "12", + "label": "12", "referenceType": "full", "alt": "\n l©nks\n", "position": { diff --git a/test/fixtures/tree/entities-advanced.nogfm.json b/test/fixtures/tree/entities-advanced.nogfm.json index b3c08ba42..7bfc493bd 100644 --- a/test/fixtures/tree/entities-advanced.nogfm.json +++ b/test/fixtures/tree/entities-advanced.nogfm.json @@ -714,6 +714,7 @@ { "type": "imageReference", "identifier": "12", + "label": "12", "referenceType": "full", "alt": "\n l©nks\n", "position": { diff --git a/test/fixtures/tree/entities-advanced.nogfm.pedantic.json b/test/fixtures/tree/entities-advanced.nogfm.pedantic.json index b3c08ba42..7bfc493bd 100644 --- a/test/fixtures/tree/entities-advanced.nogfm.pedantic.json +++ b/test/fixtures/tree/entities-advanced.nogfm.pedantic.json @@ -714,6 +714,7 @@ { "type": "imageReference", "identifier": "12", + "label": "12", "referenceType": "full", "alt": "\n l©nks\n", "position": { diff --git a/test/fixtures/tree/entities-advanced.pedantic.json b/test/fixtures/tree/entities-advanced.pedantic.json index 1abaaca0d..855357f39 100644 --- a/test/fixtures/tree/entities-advanced.pedantic.json +++ b/test/fixtures/tree/entities-advanced.pedantic.json @@ -749,6 +749,7 @@ { "type": "imageReference", "identifier": "12", + "label": "12", "referenceType": "full", "alt": "\n l©nks\n", "position": { diff --git a/test/fixtures/tree/entities.output.entities.json b/test/fixtures/tree/entities.output.entities.json index 6849cadf5..878b12f01 100644 --- a/test/fixtures/tree/entities.output.entities.json +++ b/test/fixtures/tree/entities.output.entities.json @@ -1797,6 +1797,7 @@ { "type": "imageReference", "identifier": "favicon", + "label": "favicon", "referenceType": "full", "alt": "AT&T with entity", "position": { @@ -1833,6 +1834,7 @@ { "type": "imageReference", "identifier": "favicon", + "label": "favicon", "referenceType": "full", "alt": "AT&T with numeric entity", "position": { @@ -1869,6 +1871,7 @@ { "type": "imageReference", "identifier": "favicon", + "label": "favicon", "referenceType": "full", "alt": "AT&T without entity", "position": { diff --git a/test/fixtures/tree/entities.output.entities=escape.json b/test/fixtures/tree/entities.output.entities=escape.json index dda722898..94dc2bb0b 100644 --- a/test/fixtures/tree/entities.output.entities=escape.json +++ b/test/fixtures/tree/entities.output.entities=escape.json @@ -1763,6 +1763,7 @@ { "type": "imageReference", "identifier": "favicon", + "label": "favicon", "referenceType": "full", "alt": "AT&T with entity", "position": { @@ -1799,6 +1800,7 @@ { "type": "imageReference", "identifier": "favicon", + "label": "favicon", "referenceType": "full", "alt": "AT&T with numeric entity", "position": { @@ -1835,6 +1837,7 @@ { "type": "imageReference", "identifier": "favicon", + "label": "favicon", "referenceType": "full", "alt": "AT&T without entity", "position": { diff --git a/test/fixtures/tree/entities.output.entities=numbers.json b/test/fixtures/tree/entities.output.entities=numbers.json index bec1d28c0..3a48bfd7e 100644 --- a/test/fixtures/tree/entities.output.entities=numbers.json +++ b/test/fixtures/tree/entities.output.entities=numbers.json @@ -1797,6 +1797,7 @@ { "type": "imageReference", "identifier": "favicon", + "label": "favicon", "referenceType": "full", "alt": "AT&T with entity", "position": { @@ -1833,6 +1834,7 @@ { "type": "imageReference", "identifier": "favicon", + "label": "favicon", "referenceType": "full", "alt": "AT&T with numeric entity", "position": { @@ -1869,6 +1871,7 @@ { "type": "imageReference", "identifier": "favicon", + "label": "favicon", "referenceType": "full", "alt": "AT&T without entity", "position": { diff --git a/test/fixtures/tree/entities.output.noentities.json b/test/fixtures/tree/entities.output.noentities.json index 8d4e5042f..eaf5f0672 100644 --- a/test/fixtures/tree/entities.output.noentities.json +++ b/test/fixtures/tree/entities.output.noentities.json @@ -1559,6 +1559,7 @@ { "type": "imageReference", "identifier": "favicon", + "label": "favicon", "referenceType": "full", "alt": "AT&T with entity", "position": { @@ -1595,6 +1596,7 @@ { "type": "imageReference", "identifier": "favicon", + "label": "favicon", "referenceType": "full", "alt": "AT&T with numeric entity", "position": { @@ -1631,6 +1633,7 @@ { "type": "imageReference", "identifier": "favicon", + "label": "favicon", "referenceType": "full", "alt": "AT&T without entity", "position": { diff --git a/test/fixtures/tree/footnote-without-space.json b/test/fixtures/tree/footnote-without-space.json index 22bdddd9e..6f6b68ba1 100644 --- a/test/fixtures/tree/footnote-without-space.json +++ b/test/fixtures/tree/footnote-without-space.json @@ -319,6 +319,7 @@ { "type": "imageReference", "identifier": "^footnote", + "label": "^footnote", "referenceType": "shortcut", "alt": "^footnote", "position": { diff --git a/test/fixtures/tree/link-spaces.commonmark.json b/test/fixtures/tree/link-spaces.commonmark.json index 5ae7f57be..87ded5815 100644 --- a/test/fixtures/tree/link-spaces.commonmark.json +++ b/test/fixtures/tree/link-spaces.commonmark.json @@ -80,6 +80,7 @@ { "type": "imageReference", "identifier": "charlie", + "label": "charlie", "referenceType": "shortcut", "alt": "charlie", "position": { diff --git a/test/fixtures/tree/link-spaces.json b/test/fixtures/tree/link-spaces.json index 5ae7f57be..87ded5815 100644 --- a/test/fixtures/tree/link-spaces.json +++ b/test/fixtures/tree/link-spaces.json @@ -80,6 +80,7 @@ { "type": "imageReference", "identifier": "charlie", + "label": "charlie", "referenceType": "shortcut", "alt": "charlie", "position": { diff --git a/test/fixtures/tree/link-spaces.nogfm.commonmark.json b/test/fixtures/tree/link-spaces.nogfm.commonmark.json index 5ae7f57be..87ded5815 100644 --- a/test/fixtures/tree/link-spaces.nogfm.commonmark.json +++ b/test/fixtures/tree/link-spaces.nogfm.commonmark.json @@ -80,6 +80,7 @@ { "type": "imageReference", "identifier": "charlie", + "label": "charlie", "referenceType": "shortcut", "alt": "charlie", "position": { diff --git a/test/fixtures/tree/link-spaces.nogfm.json b/test/fixtures/tree/link-spaces.nogfm.json index 5ae7f57be..87ded5815 100644 --- a/test/fixtures/tree/link-spaces.nogfm.json +++ b/test/fixtures/tree/link-spaces.nogfm.json @@ -80,6 +80,7 @@ { "type": "imageReference", "identifier": "charlie", + "label": "charlie", "referenceType": "shortcut", "alt": "charlie", "position": { diff --git a/test/fixtures/tree/link-whitespace.commonmark.json b/test/fixtures/tree/link-whitespace.commonmark.json index 06c6ecd44..f60d6aae2 100644 --- a/test/fixtures/tree/link-whitespace.commonmark.json +++ b/test/fixtures/tree/link-whitespace.commonmark.json @@ -392,6 +392,7 @@ { "type": "imageReference", "identifier": "alpha", + "label": "alpha", "referenceType": "shortcut", "alt": "alpha", "position": { @@ -500,6 +501,7 @@ { "type": "imageReference", "identifier": "alpha", + "label": "alpha", "referenceType": "shortcut", "alt": "alpha", "position": { @@ -608,6 +610,7 @@ { "type": "imageReference", "identifier": "alpha", + "label": "alpha", "referenceType": "shortcut", "alt": "alpha", "position": { diff --git a/test/fixtures/tree/link-whitespace.json b/test/fixtures/tree/link-whitespace.json index 06c6ecd44..f60d6aae2 100644 --- a/test/fixtures/tree/link-whitespace.json +++ b/test/fixtures/tree/link-whitespace.json @@ -392,6 +392,7 @@ { "type": "imageReference", "identifier": "alpha", + "label": "alpha", "referenceType": "shortcut", "alt": "alpha", "position": { @@ -500,6 +501,7 @@ { "type": "imageReference", "identifier": "alpha", + "label": "alpha", "referenceType": "shortcut", "alt": "alpha", "position": { @@ -608,6 +610,7 @@ { "type": "imageReference", "identifier": "alpha", + "label": "alpha", "referenceType": "shortcut", "alt": "alpha", "position": { diff --git a/test/fixtures/tree/links-title-double-quotes-delimiters.commonmark.json b/test/fixtures/tree/links-title-double-quotes-delimiters.commonmark.json index 0fa419177..e25b17ef8 100644 --- a/test/fixtures/tree/links-title-double-quotes-delimiters.commonmark.json +++ b/test/fixtures/tree/links-title-double-quotes-delimiters.commonmark.json @@ -153,6 +153,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -207,6 +208,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-title-double-quotes-mismatched-delimiters.commonmark.json b/test/fixtures/tree/links-title-double-quotes-mismatched-delimiters.commonmark.json index 66137d074..3e9d2ccfd 100644 --- a/test/fixtures/tree/links-title-double-quotes-mismatched-delimiters.commonmark.json +++ b/test/fixtures/tree/links-title-double-quotes-mismatched-delimiters.commonmark.json @@ -153,6 +153,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -207,6 +208,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-title-empty-parentheses.json b/test/fixtures/tree/links-title-empty-parentheses.json index af7ca1ef5..812777cd2 100644 --- a/test/fixtures/tree/links-title-empty-parentheses.json +++ b/test/fixtures/tree/links-title-empty-parentheses.json @@ -153,6 +153,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -207,6 +208,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-title-empty-parentheses.nogfm.json b/test/fixtures/tree/links-title-empty-parentheses.nogfm.json index af7ca1ef5..812777cd2 100644 --- a/test/fixtures/tree/links-title-empty-parentheses.nogfm.json +++ b/test/fixtures/tree/links-title-empty-parentheses.nogfm.json @@ -153,6 +153,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -207,6 +208,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-title-parentheses.json b/test/fixtures/tree/links-title-parentheses.json index 8fc27352a..c25fe3b28 100644 --- a/test/fixtures/tree/links-title-parentheses.json +++ b/test/fixtures/tree/links-title-parentheses.json @@ -153,6 +153,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -207,6 +208,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-title-parentheses.nogfm.json b/test/fixtures/tree/links-title-parentheses.nogfm.json index 8fc27352a..c25fe3b28 100644 --- a/test/fixtures/tree/links-title-parentheses.nogfm.json +++ b/test/fixtures/tree/links-title-parentheses.nogfm.json @@ -153,6 +153,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -207,6 +208,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-title-single-quotes-delimiters.commonmark.json b/test/fixtures/tree/links-title-single-quotes-delimiters.commonmark.json index 9a5200cf0..a1efa11aa 100644 --- a/test/fixtures/tree/links-title-single-quotes-delimiters.commonmark.json +++ b/test/fixtures/tree/links-title-single-quotes-delimiters.commonmark.json @@ -153,6 +153,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -207,6 +208,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-title-single-quotes-mismatched-delimiters.commonmark.json b/test/fixtures/tree/links-title-single-quotes-mismatched-delimiters.commonmark.json index 5c51b7f0b..48e1b6595 100644 --- a/test/fixtures/tree/links-title-single-quotes-mismatched-delimiters.commonmark.json +++ b/test/fixtures/tree/links-title-single-quotes-mismatched-delimiters.commonmark.json @@ -153,6 +153,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -207,6 +208,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-title-unclosed.commonmark.json b/test/fixtures/tree/links-title-unclosed.commonmark.json index 29e4947a4..19a897801 100644 --- a/test/fixtures/tree/links-title-unclosed.commonmark.json +++ b/test/fixtures/tree/links-title-unclosed.commonmark.json @@ -153,6 +153,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -207,6 +208,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -407,6 +409,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -461,6 +464,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -661,6 +665,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -715,6 +720,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-title-unclosed.json b/test/fixtures/tree/links-title-unclosed.json index 29e4947a4..19a897801 100644 --- a/test/fixtures/tree/links-title-unclosed.json +++ b/test/fixtures/tree/links-title-unclosed.json @@ -153,6 +153,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -207,6 +208,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -407,6 +409,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -461,6 +464,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -661,6 +665,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -715,6 +720,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-title-unclosed.nogfm.json b/test/fixtures/tree/links-title-unclosed.nogfm.json index 29e4947a4..19a897801 100644 --- a/test/fixtures/tree/links-title-unclosed.nogfm.json +++ b/test/fixtures/tree/links-title-unclosed.nogfm.json @@ -153,6 +153,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -207,6 +208,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -407,6 +409,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -461,6 +464,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -661,6 +665,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -715,6 +720,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-url-empty-title-parentheses.json b/test/fixtures/tree/links-url-empty-title-parentheses.json index 40262f1e7..98a159056 100644 --- a/test/fixtures/tree/links-url-empty-title-parentheses.json +++ b/test/fixtures/tree/links-url-empty-title-parentheses.json @@ -332,6 +332,7 @@ { "type": "imageReference", "identifier": "world", + "label": "World", "referenceType": "shortcut", "alt": "World", "position": { diff --git a/test/fixtures/tree/links-url-empty-title-parentheses.nogfm.json b/test/fixtures/tree/links-url-empty-title-parentheses.nogfm.json index 40262f1e7..98a159056 100644 --- a/test/fixtures/tree/links-url-empty-title-parentheses.nogfm.json +++ b/test/fixtures/tree/links-url-empty-title-parentheses.nogfm.json @@ -332,6 +332,7 @@ { "type": "imageReference", "identifier": "world", + "label": "World", "referenceType": "shortcut", "alt": "World", "position": { diff --git a/test/fixtures/tree/links-url-mismatched-parentheses.commonmark.json b/test/fixtures/tree/links-url-mismatched-parentheses.commonmark.json index 9d4a25659..4fe66ed5e 100644 --- a/test/fixtures/tree/links-url-mismatched-parentheses.commonmark.json +++ b/test/fixtures/tree/links-url-mismatched-parentheses.commonmark.json @@ -296,6 +296,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-url-mismatched-parentheses.json b/test/fixtures/tree/links-url-mismatched-parentheses.json index 9d4a25659..4fe66ed5e 100644 --- a/test/fixtures/tree/links-url-mismatched-parentheses.json +++ b/test/fixtures/tree/links-url-mismatched-parentheses.json @@ -296,6 +296,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-url-mismatched-parentheses.nogfm.json b/test/fixtures/tree/links-url-mismatched-parentheses.nogfm.json index 9d4a25659..4fe66ed5e 100644 --- a/test/fixtures/tree/links-url-mismatched-parentheses.nogfm.json +++ b/test/fixtures/tree/links-url-mismatched-parentheses.nogfm.json @@ -296,6 +296,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-url-new-line.commonmark.json b/test/fixtures/tree/links-url-new-line.commonmark.json index 2a6367f7a..8cc4fde07 100644 --- a/test/fixtures/tree/links-url-new-line.commonmark.json +++ b/test/fixtures/tree/links-url-new-line.commonmark.json @@ -161,6 +161,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -219,6 +220,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-url-new-line.json b/test/fixtures/tree/links-url-new-line.json index 08cb5cb49..424236e18 100644 --- a/test/fixtures/tree/links-url-new-line.json +++ b/test/fixtures/tree/links-url-new-line.json @@ -160,6 +160,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-url-new-line.nogfm.json b/test/fixtures/tree/links-url-new-line.nogfm.json index 08cb5cb49..424236e18 100644 --- a/test/fixtures/tree/links-url-new-line.nogfm.json +++ b/test/fixtures/tree/links-url-new-line.nogfm.json @@ -160,6 +160,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-url-unclosed.json b/test/fixtures/tree/links-url-unclosed.json index 686b4c440..1d479482c 100644 --- a/test/fixtures/tree/links-url-unclosed.json +++ b/test/fixtures/tree/links-url-unclosed.json @@ -153,6 +153,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -207,6 +208,7 @@ { "type": "imageReference", "identifier": "world", + "label": "World", "referenceType": "shortcut", "alt": "World", "position": { diff --git a/test/fixtures/tree/links-url-white-space.commonmark.json b/test/fixtures/tree/links-url-white-space.commonmark.json index 20bc28895..4c037aa51 100644 --- a/test/fixtures/tree/links-url-white-space.commonmark.json +++ b/test/fixtures/tree/links-url-white-space.commonmark.json @@ -152,6 +152,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-url-white-space.json b/test/fixtures/tree/links-url-white-space.json index 20bc28895..4c037aa51 100644 --- a/test/fixtures/tree/links-url-white-space.json +++ b/test/fixtures/tree/links-url-white-space.json @@ -152,6 +152,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/links-url-white-space.nogfm.json b/test/fixtures/tree/links-url-white-space.nogfm.json index 20bc28895..4c037aa51 100644 --- a/test/fixtures/tree/links-url-white-space.nogfm.json +++ b/test/fixtures/tree/links-url-white-space.nogfm.json @@ -152,6 +152,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/nested-references.commonmark.footnotes.json b/test/fixtures/tree/nested-references.commonmark.footnotes.json index 8397c8126..b93a1b915 100644 --- a/test/fixtures/tree/nested-references.commonmark.footnotes.json +++ b/test/fixtures/tree/nested-references.commonmark.footnotes.json @@ -48,6 +48,7 @@ { "type": "imageReference", "identifier": "bar", + "label": "bar", "referenceType": "full", "alt": "Foo", "position": { diff --git a/test/fixtures/tree/nested-references.commonmark.json b/test/fixtures/tree/nested-references.commonmark.json index 720f0ddd8..284918b2c 100644 --- a/test/fixtures/tree/nested-references.commonmark.json +++ b/test/fixtures/tree/nested-references.commonmark.json @@ -48,6 +48,7 @@ { "type": "imageReference", "identifier": "bar", + "label": "bar", "referenceType": "full", "alt": "Foo", "position": { diff --git a/test/fixtures/tree/nested-references.footnotes.json b/test/fixtures/tree/nested-references.footnotes.json index 8397c8126..b93a1b915 100644 --- a/test/fixtures/tree/nested-references.footnotes.json +++ b/test/fixtures/tree/nested-references.footnotes.json @@ -48,6 +48,7 @@ { "type": "imageReference", "identifier": "bar", + "label": "bar", "referenceType": "full", "alt": "Foo", "position": { diff --git a/test/fixtures/tree/nested-references.json b/test/fixtures/tree/nested-references.json index 720f0ddd8..284918b2c 100644 --- a/test/fixtures/tree/nested-references.json +++ b/test/fixtures/tree/nested-references.json @@ -48,6 +48,7 @@ { "type": "imageReference", "identifier": "bar", + "label": "bar", "referenceType": "full", "alt": "Foo", "position": { diff --git a/test/fixtures/tree/reference-image-empty-alt.json b/test/fixtures/tree/reference-image-empty-alt.json index e0b44cab6..1902a606e 100644 --- a/test/fixtures/tree/reference-image-empty-alt.json +++ b/test/fixtures/tree/reference-image-empty-alt.json @@ -7,6 +7,7 @@ { "type": "imageReference", "identifier": "1", + "label": "1", "referenceType": "full", "alt": null, "position": { diff --git a/test/fixtures/tree/reference-link-escape.nooutput.json b/test/fixtures/tree/reference-link-escape.nooutput.json index 8739c6841..fa1a411c3 100644 --- a/test/fixtures/tree/reference-link-escape.nooutput.json +++ b/test/fixtures/tree/reference-link-escape.nooutput.json @@ -292,6 +292,7 @@ { "type": "imageReference", "identifier": "b\\*r*", + "label": "b\\*r*", "referenceType": "full", "alt": "foo", "position": { @@ -328,6 +329,7 @@ { "type": "imageReference", "identifier": "b\\*r*", + "label": "b\\*r*", "referenceType": "collapsed", "alt": "b*r*", "position": { @@ -364,6 +366,7 @@ { "type": "imageReference", "identifier": "b\\*r*", + "label": "b\\*r*", "referenceType": "shortcut", "alt": "b*r*", "position": { diff --git a/test/fixtures/tree/title-attributes.commonmark.json b/test/fixtures/tree/title-attributes.commonmark.json index 3cb64e8e9..c386b38bd 100644 --- a/test/fixtures/tree/title-attributes.commonmark.json +++ b/test/fixtures/tree/title-attributes.commonmark.json @@ -4007,6 +4007,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -4061,6 +4062,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -4299,6 +4301,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -4353,6 +4356,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/title-attributes.json b/test/fixtures/tree/title-attributes.json index 863e28932..5ee5a655f 100644 --- a/test/fixtures/tree/title-attributes.json +++ b/test/fixtures/tree/title-attributes.json @@ -4709,6 +4709,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -4763,6 +4764,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -4817,6 +4819,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -4871,6 +4874,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -4993,6 +4997,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -5115,6 +5120,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/title-attributes.nogfm.commonmark.json b/test/fixtures/tree/title-attributes.nogfm.commonmark.json index c56d055ab..c5583a0aa 100644 --- a/test/fixtures/tree/title-attributes.nogfm.commonmark.json +++ b/test/fixtures/tree/title-attributes.nogfm.commonmark.json @@ -1710,6 +1710,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -1764,6 +1765,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -2002,6 +2004,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -2056,6 +2059,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { diff --git a/test/fixtures/tree/title-attributes.nogfm.json b/test/fixtures/tree/title-attributes.nogfm.json index c8fa613a0..824167ca0 100644 --- a/test/fixtures/tree/title-attributes.nogfm.json +++ b/test/fixtures/tree/title-attributes.nogfm.json @@ -2412,6 +2412,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -2466,6 +2467,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -2520,6 +2522,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -2574,6 +2577,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -2696,6 +2700,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { @@ -2818,6 +2823,7 @@ { "type": "imageReference", "identifier": "hello", + "label": "Hello", "referenceType": "shortcut", "alt": "Hello", "position": { From 90290cae26862fba93fb2ebe44599c6d682629d0 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Sat, 6 Oct 2018 11:09:22 +0200 Subject: [PATCH 5/7] remark-parse: add label to footnote reference --- packages/remark-parse/lib/tokenize/reference.js | 4 ++-- packages/remark-stringify/lib/visitors/footnote-reference.js | 2 +- .../{footnote-proto.nooutput.text => footnote-proto.text} | 0 test/fixtures/tree/footnote-consecutive.footnotes.json | 5 +++++ .../tree/footnote-consecutive.footnotes.pedantic.json | 5 +++++ test/fixtures/tree/footnote-duplicate.footnotes.json | 1 + .../fixtures/tree/footnote-duplicate.footnotes.pedantic.json | 1 + test/fixtures/tree/footnote-escape.footnotes.json | 1 + test/fixtures/tree/footnote-ids.footnotes.json | 1 + test/fixtures/tree/footnote-indent.footnotes.json | 1 + test/fixtures/tree/footnote-like.footnotes.json | 1 + test/fixtures/tree/footnote-matrix.footnotes.json | 3 +++ test/fixtures/tree/footnote-multiple.footnotes.json | 2 ++ test/fixtures/tree/footnote-multiple.footnotes.pedantic.json | 2 ++ test/fixtures/tree/footnote-nested.footnotes.json | 1 + ...nooutput.footnotes.json => footnote-proto.footnotes.json} | 3 +++ .../{footnote-proto.nooutput.json => footnote-proto.json} | 0 test/fixtures/tree/footnote-without-space.footnotes.json | 5 +++++ test/fixtures/tree/footnote.footnotes.json | 2 ++ test/fixtures/tree/footnote.output.footnotes.json | 3 +++ .../tree/list-continuation.commonmark.footnotes.json | 2 ++ .../list-continuation.commonmark.footnotes.pedantic.json | 2 ++ test/fixtures/tree/list-continuation.footnotes.json | 1 + test/fixtures/tree/list-continuation.footnotes.pedantic.json | 1 + .../tree/list-continuation.nogfm.commonmark.footnotes.json | 2 ++ ...ist-continuation.nogfm.commonmark.footnotes.pedantic.json | 2 ++ test/fixtures/tree/list-continuation.nogfm.footnotes.json | 1 + .../tree/list-continuation.nogfm.footnotes.pedantic.json | 1 + .../tree/nested-references.commonmark.footnotes.json | 1 + test/fixtures/tree/nested-references.footnotes.json | 1 + 30 files changed, 54 insertions(+), 3 deletions(-) rename test/fixtures/input/{footnote-proto.nooutput.text => footnote-proto.text} (100%) rename test/fixtures/tree/{footnote-proto.nooutput.footnotes.json => footnote-proto.footnotes.json} (98%) rename test/fixtures/tree/{footnote-proto.nooutput.json => footnote-proto.json} (100%) diff --git a/packages/remark-parse/lib/tokenize/reference.js b/packages/remark-parse/lib/tokenize/reference.js index 572069ef4..27947dbe4 100644 --- a/packages/remark-parse/lib/tokenize/reference.js +++ b/packages/remark-parse/lib/tokenize/reference.js @@ -193,11 +193,11 @@ function reference(eat, value, silent) { node = { type: type + 'Reference', - identifier: normalize(identifier) + identifier: normalize(identifier), + label: identifier }; if (type === T_LINK || type === T_IMAGE) { - node.label = identifier; node.referenceType = referenceType; } diff --git a/packages/remark-stringify/lib/visitors/footnote-reference.js b/packages/remark-stringify/lib/visitors/footnote-reference.js index c6dccc4cd..b1273b447 100644 --- a/packages/remark-stringify/lib/visitors/footnote-reference.js +++ b/packages/remark-stringify/lib/visitors/footnote-reference.js @@ -3,5 +3,5 @@ module.exports = footnoteReference; function footnoteReference(node) { - return '[^' + node.identifier + ']'; + return '[^' + (node.label || node.identifier) + ']'; } diff --git a/test/fixtures/input/footnote-proto.nooutput.text b/test/fixtures/input/footnote-proto.text similarity index 100% rename from test/fixtures/input/footnote-proto.nooutput.text rename to test/fixtures/input/footnote-proto.text diff --git a/test/fixtures/tree/footnote-consecutive.footnotes.json b/test/fixtures/tree/footnote-consecutive.footnotes.json index 93bee2ad2..6455b6e99 100644 --- a/test/fixtures/tree/footnote-consecutive.footnotes.json +++ b/test/fixtures/tree/footnote-consecutive.footnotes.json @@ -25,6 +25,7 @@ { "type": "footnoteReference", "identifier": "wiki", + "label": "wiki", "position": { "start": { "line": 1, @@ -77,6 +78,7 @@ { "type": "footnoteReference", "identifier": "wiki", + "label": "wiki", "position": { "start": { "line": 3, @@ -94,6 +96,7 @@ { "type": "footnoteReference", "identifier": "wiki2", + "label": "wiki2", "position": { "start": { "line": 3, @@ -128,6 +131,7 @@ { "type": "footnoteReference", "identifier": "name", + "label": "name", "position": { "start": { "line": 3, @@ -145,6 +149,7 @@ { "type": "footnoteReference", "identifier": "consecutive", + "label": "consecutive", "position": { "start": { "line": 3, diff --git a/test/fixtures/tree/footnote-consecutive.footnotes.pedantic.json b/test/fixtures/tree/footnote-consecutive.footnotes.pedantic.json index 93bee2ad2..6455b6e99 100644 --- a/test/fixtures/tree/footnote-consecutive.footnotes.pedantic.json +++ b/test/fixtures/tree/footnote-consecutive.footnotes.pedantic.json @@ -25,6 +25,7 @@ { "type": "footnoteReference", "identifier": "wiki", + "label": "wiki", "position": { "start": { "line": 1, @@ -77,6 +78,7 @@ { "type": "footnoteReference", "identifier": "wiki", + "label": "wiki", "position": { "start": { "line": 3, @@ -94,6 +96,7 @@ { "type": "footnoteReference", "identifier": "wiki2", + "label": "wiki2", "position": { "start": { "line": 3, @@ -128,6 +131,7 @@ { "type": "footnoteReference", "identifier": "name", + "label": "name", "position": { "start": { "line": 3, @@ -145,6 +149,7 @@ { "type": "footnoteReference", "identifier": "consecutive", + "label": "consecutive", "position": { "start": { "line": 3, diff --git a/test/fixtures/tree/footnote-duplicate.footnotes.json b/test/fixtures/tree/footnote-duplicate.footnotes.json index e5966adee..2c9267f62 100644 --- a/test/fixtures/tree/footnote-duplicate.footnotes.json +++ b/test/fixtures/tree/footnote-duplicate.footnotes.json @@ -24,6 +24,7 @@ { "type": "footnoteReference", "identifier": "wiki", + "label": "wiki", "position": { "start": { "line": 1, diff --git a/test/fixtures/tree/footnote-duplicate.footnotes.pedantic.json b/test/fixtures/tree/footnote-duplicate.footnotes.pedantic.json index e5966adee..2c9267f62 100644 --- a/test/fixtures/tree/footnote-duplicate.footnotes.pedantic.json +++ b/test/fixtures/tree/footnote-duplicate.footnotes.pedantic.json @@ -24,6 +24,7 @@ { "type": "footnoteReference", "identifier": "wiki", + "label": "wiki", "position": { "start": { "line": 1, diff --git a/test/fixtures/tree/footnote-escape.footnotes.json b/test/fixtures/tree/footnote-escape.footnotes.json index 37d441c91..0c6c096b5 100644 --- a/test/fixtures/tree/footnote-escape.footnotes.json +++ b/test/fixtures/tree/footnote-escape.footnotes.json @@ -24,6 +24,7 @@ { "type": "footnoteReference", "identifier": "wi\\-ki", + "label": "wi\\-ki", "position": { "start": { "line": 1, diff --git a/test/fixtures/tree/footnote-ids.footnotes.json b/test/fixtures/tree/footnote-ids.footnotes.json index 7063fd177..b5680c4b7 100644 --- a/test/fixtures/tree/footnote-ids.footnotes.json +++ b/test/fixtures/tree/footnote-ids.footnotes.json @@ -76,6 +76,7 @@ { "type": "footnoteReference", "identifier": "1", + "label": "1", "position": { "start": { "line": 1, diff --git a/test/fixtures/tree/footnote-indent.footnotes.json b/test/fixtures/tree/footnote-indent.footnotes.json index d934bbfdb..6b314e14b 100644 --- a/test/fixtures/tree/footnote-indent.footnotes.json +++ b/test/fixtures/tree/footnote-indent.footnotes.json @@ -24,6 +24,7 @@ { "type": "footnoteReference", "identifier": "wiki", + "label": "wiki", "position": { "start": { "line": 1, diff --git a/test/fixtures/tree/footnote-like.footnotes.json b/test/fixtures/tree/footnote-like.footnotes.json index ddfa7ad55..d955638c3 100644 --- a/test/fixtures/tree/footnote-like.footnotes.json +++ b/test/fixtures/tree/footnote-like.footnotes.json @@ -97,6 +97,7 @@ { "type": "footnoteReference", "identifier": "both", + "label": "both", "position": { "start": { "line": 3, diff --git a/test/fixtures/tree/footnote-matrix.footnotes.json b/test/fixtures/tree/footnote-matrix.footnotes.json index 550fb3281..677774323 100644 --- a/test/fixtures/tree/footnote-matrix.footnotes.json +++ b/test/fixtures/tree/footnote-matrix.footnotes.json @@ -94,6 +94,7 @@ { "type": "footnoteReference", "identifier": "foo", + "label": "foo", "position": { "start": { "line": 2, @@ -263,6 +264,7 @@ { "type": "footnoteReference", "identifier": "foo", + "label": "foo", "position": { "start": { "line": 4, @@ -280,6 +282,7 @@ { "type": "footnoteReference", "identifier": "bar", + "label": "bar", "position": { "start": { "line": 4, diff --git a/test/fixtures/tree/footnote-multiple.footnotes.json b/test/fixtures/tree/footnote-multiple.footnotes.json index 2ee378d66..c43aa8f2b 100644 --- a/test/fixtures/tree/footnote-multiple.footnotes.json +++ b/test/fixtures/tree/footnote-multiple.footnotes.json @@ -25,6 +25,7 @@ { "type": "footnoteReference", "identifier": "wiki", + "label": "wiki", "position": { "start": { "line": 1, @@ -77,6 +78,7 @@ { "type": "footnoteReference", "identifier": "wiki", + "label": "wiki", "position": { "start": { "line": 3, diff --git a/test/fixtures/tree/footnote-multiple.footnotes.pedantic.json b/test/fixtures/tree/footnote-multiple.footnotes.pedantic.json index 2ee378d66..c43aa8f2b 100644 --- a/test/fixtures/tree/footnote-multiple.footnotes.pedantic.json +++ b/test/fixtures/tree/footnote-multiple.footnotes.pedantic.json @@ -25,6 +25,7 @@ { "type": "footnoteReference", "identifier": "wiki", + "label": "wiki", "position": { "start": { "line": 1, @@ -77,6 +78,7 @@ { "type": "footnoteReference", "identifier": "wiki", + "label": "wiki", "position": { "start": { "line": 3, diff --git a/test/fixtures/tree/footnote-nested.footnotes.json b/test/fixtures/tree/footnote-nested.footnotes.json index d694cdd04..36c4d1b8c 100644 --- a/test/fixtures/tree/footnote-nested.footnotes.json +++ b/test/fixtures/tree/footnote-nested.footnotes.json @@ -24,6 +24,7 @@ { "type": "footnoteReference", "identifier": "1", + "label": "1", "position": { "start": { "line": 1, diff --git a/test/fixtures/tree/footnote-proto.nooutput.footnotes.json b/test/fixtures/tree/footnote-proto.footnotes.json similarity index 98% rename from test/fixtures/tree/footnote-proto.nooutput.footnotes.json rename to test/fixtures/tree/footnote-proto.footnotes.json index 78696c1b0..355a7f38d 100644 --- a/test/fixtures/tree/footnote-proto.nooutput.footnotes.json +++ b/test/fixtures/tree/footnote-proto.footnotes.json @@ -24,6 +24,7 @@ { "type": "footnoteReference", "identifier": "tostring", + "label": "toString", "position": { "start": { "line": 1, @@ -58,6 +59,7 @@ { "type": "footnoteReference", "identifier": "__proto__", + "label": "__proto__", "position": { "start": { "line": 1, @@ -92,6 +94,7 @@ { "type": "footnoteReference", "identifier": "constructor", + "label": "constructor", "position": { "start": { "line": 1, diff --git a/test/fixtures/tree/footnote-proto.nooutput.json b/test/fixtures/tree/footnote-proto.json similarity index 100% rename from test/fixtures/tree/footnote-proto.nooutput.json rename to test/fixtures/tree/footnote-proto.json diff --git a/test/fixtures/tree/footnote-without-space.footnotes.json b/test/fixtures/tree/footnote-without-space.footnotes.json index cb1a7c7a0..40e996dc6 100644 --- a/test/fixtures/tree/footnote-without-space.footnotes.json +++ b/test/fixtures/tree/footnote-without-space.footnotes.json @@ -24,6 +24,7 @@ { "type": "footnoteReference", "identifier": "abc", + "label": "abc", "position": { "start": { "line": 1, @@ -58,6 +59,7 @@ { "type": "footnoteReference", "identifier": "xyz", + "label": "xyz", "position": { "start": { "line": 1, @@ -220,6 +222,7 @@ { "type": "footnoteReference", "identifier": "footnote", + "label": "footnote", "position": { "start": { "line": 6, @@ -256,6 +259,7 @@ { "type": "footnoteReference", "identifier": "footnote", + "label": "footnote", "position": { "start": { "line": 7, @@ -292,6 +296,7 @@ { "type": "footnoteReference", "identifier": "footnote", + "label": "footnote", "position": { "start": { "line": 8, diff --git a/test/fixtures/tree/footnote.footnotes.json b/test/fixtures/tree/footnote.footnotes.json index 3f151d812..97864b43e 100644 --- a/test/fixtures/tree/footnote.footnotes.json +++ b/test/fixtures/tree/footnote.footnotes.json @@ -24,6 +24,7 @@ { "type": "footnoteReference", "identifier": "somesamplefootnote", + "label": "somesamplefootnote", "position": { "start": { "line": 1, @@ -203,6 +204,7 @@ { "type": "footnoteReference", "identifier": "documentdetails", + "label": "documentdetails", "position": { "start": { "line": 5, diff --git a/test/fixtures/tree/footnote.output.footnotes.json b/test/fixtures/tree/footnote.output.footnotes.json index f4bb1f4f4..a5f61338b 100644 --- a/test/fixtures/tree/footnote.output.footnotes.json +++ b/test/fixtures/tree/footnote.output.footnotes.json @@ -24,6 +24,7 @@ { "type": "footnoteReference", "identifier": "1", + "label": "1", "position": { "start": { "line": 1, @@ -93,6 +94,7 @@ { "type": "footnoteReference", "identifier": "2", + "label": "2", "position": { "start": { "line": 3, @@ -219,6 +221,7 @@ { "type": "footnoteReference", "identifier": "3", + "label": "3", "position": { "start": { "line": 5, diff --git a/test/fixtures/tree/list-continuation.commonmark.footnotes.json b/test/fixtures/tree/list-continuation.commonmark.footnotes.json index 17ea5c4ff..d779a856d 100644 --- a/test/fixtures/tree/list-continuation.commonmark.footnotes.json +++ b/test/fixtures/tree/list-continuation.commonmark.footnotes.json @@ -422,6 +422,7 @@ { "type": "footnoteReference", "identifier": "foo", + "label": "foo", "position": { "start": { "line": 15, @@ -458,6 +459,7 @@ { "type": "footnoteReference", "identifier": "foo", + "label": "foo", "position": { "start": { "line": 16, diff --git a/test/fixtures/tree/list-continuation.commonmark.footnotes.pedantic.json b/test/fixtures/tree/list-continuation.commonmark.footnotes.pedantic.json index 80699fe56..049a21794 100644 --- a/test/fixtures/tree/list-continuation.commonmark.footnotes.pedantic.json +++ b/test/fixtures/tree/list-continuation.commonmark.footnotes.pedantic.json @@ -421,6 +421,7 @@ { "type": "footnoteReference", "identifier": "foo", + "label": "foo", "position": { "start": { "line": 15, @@ -457,6 +458,7 @@ { "type": "footnoteReference", "identifier": "foo", + "label": "foo", "position": { "start": { "line": 16, diff --git a/test/fixtures/tree/list-continuation.footnotes.json b/test/fixtures/tree/list-continuation.footnotes.json index c4613b820..575bf9f6e 100644 --- a/test/fixtures/tree/list-continuation.footnotes.json +++ b/test/fixtures/tree/list-continuation.footnotes.json @@ -325,6 +325,7 @@ { "type": "footnoteReference", "identifier": "foo", + "label": "foo", "position": { "start": { "line": 15, diff --git a/test/fixtures/tree/list-continuation.footnotes.pedantic.json b/test/fixtures/tree/list-continuation.footnotes.pedantic.json index 6e05c24fe..fdaa2dd0a 100644 --- a/test/fixtures/tree/list-continuation.footnotes.pedantic.json +++ b/test/fixtures/tree/list-continuation.footnotes.pedantic.json @@ -324,6 +324,7 @@ { "type": "footnoteReference", "identifier": "foo", + "label": "foo", "position": { "start": { "line": 15, diff --git a/test/fixtures/tree/list-continuation.nogfm.commonmark.footnotes.json b/test/fixtures/tree/list-continuation.nogfm.commonmark.footnotes.json index e4fab2388..5a4f7b8f9 100644 --- a/test/fixtures/tree/list-continuation.nogfm.commonmark.footnotes.json +++ b/test/fixtures/tree/list-continuation.nogfm.commonmark.footnotes.json @@ -397,6 +397,7 @@ { "type": "footnoteReference", "identifier": "foo", + "label": "foo", "position": { "start": { "line": 15, @@ -433,6 +434,7 @@ { "type": "footnoteReference", "identifier": "foo", + "label": "foo", "position": { "start": { "line": 16, diff --git a/test/fixtures/tree/list-continuation.nogfm.commonmark.footnotes.pedantic.json b/test/fixtures/tree/list-continuation.nogfm.commonmark.footnotes.pedantic.json index 9d17a0a44..24ba60d69 100644 --- a/test/fixtures/tree/list-continuation.nogfm.commonmark.footnotes.pedantic.json +++ b/test/fixtures/tree/list-continuation.nogfm.commonmark.footnotes.pedantic.json @@ -388,6 +388,7 @@ { "type": "footnoteReference", "identifier": "foo", + "label": "foo", "position": { "start": { "line": 15, @@ -424,6 +425,7 @@ { "type": "footnoteReference", "identifier": "foo", + "label": "foo", "position": { "start": { "line": 16, diff --git a/test/fixtures/tree/list-continuation.nogfm.footnotes.json b/test/fixtures/tree/list-continuation.nogfm.footnotes.json index d52113467..9b6cad8da 100644 --- a/test/fixtures/tree/list-continuation.nogfm.footnotes.json +++ b/test/fixtures/tree/list-continuation.nogfm.footnotes.json @@ -337,6 +337,7 @@ { "type": "footnoteReference", "identifier": "foo", + "label": "foo", "position": { "start": { "line": 15, diff --git a/test/fixtures/tree/list-continuation.nogfm.footnotes.pedantic.json b/test/fixtures/tree/list-continuation.nogfm.footnotes.pedantic.json index 6edebf801..4c3416788 100644 --- a/test/fixtures/tree/list-continuation.nogfm.footnotes.pedantic.json +++ b/test/fixtures/tree/list-continuation.nogfm.footnotes.pedantic.json @@ -328,6 +328,7 @@ { "type": "footnoteReference", "identifier": "foo", + "label": "foo", "position": { "start": { "line": 15, diff --git a/test/fixtures/tree/nested-references.commonmark.footnotes.json b/test/fixtures/tree/nested-references.commonmark.footnotes.json index b93a1b915..939ede909 100644 --- a/test/fixtures/tree/nested-references.commonmark.footnotes.json +++ b/test/fixtures/tree/nested-references.commonmark.footnotes.json @@ -233,6 +233,7 @@ { "type": "footnoteReference", "identifier": "foo", + "label": "foo", "position": { "start": { "line": 11, diff --git a/test/fixtures/tree/nested-references.footnotes.json b/test/fixtures/tree/nested-references.footnotes.json index b93a1b915..939ede909 100644 --- a/test/fixtures/tree/nested-references.footnotes.json +++ b/test/fixtures/tree/nested-references.footnotes.json @@ -233,6 +233,7 @@ { "type": "footnoteReference", "identifier": "foo", + "label": "foo", "position": { "start": { "line": 11, From 396e8878b6230458faabe9237cd8be06543fd890 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Sat, 6 Oct 2018 11:29:20 +0200 Subject: [PATCH 6/7] Add tests for associations without label --- test/remark-stringify.js | 87 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/test/remark-stringify.js b/test/remark-stringify.js index 5ff6b63d9..eaa54b5f9 100644 --- a/test/remark-stringify.js +++ b/test/remark-stringify.js @@ -255,6 +255,93 @@ test('remark().stringify(ast, file)', function (t) { }); }); + t.test('should process references with casing properly', function (st) { + /* Data-driven tests in the format: [name, value] */ + var tests = [ + ['capitalized link references - full', '[alpha][Bravo]'], + ['capitalized link references - collapsed', '[Bravo][]'], + ['capitalized link references - shortcut', '[Bravo]'], + ['capitalized image references - full', '![alpha][Bravo]'], + ['capitalized image references - collapsed', '![Bravo][]'], + ['capitalized image references - shortcut', '![Bravo]'], + ['capitalized footnote references', '[^Alpha]'] + ]; + + tests.forEach(each); + + st.end(); + + function each(test) { + st.equal( + remark() + .processSync(test[1]) + .toString(), + test[1] + '\n', + test[0] + ); + } + }); + + t.test('should process associations without label', function (st) { + st.equal( + stringify({ + type: 'definition', + identifier: 'a', + url: 'example.com' + }), + '[a]: example.com', + 'definition' + ); + + st.equal( + stringify({ + type: 'footnoteDefinition', + identifier: 'a', + children: [{ + type: 'paragraph', + children: [{type: 'text', value: 'b'}] + }] + }), + '[^a]: b', + 'footnote definition' + ); + + st.equal( + stringify({ + type: 'linkReference', + identifier: 'a', + children: [{type: 'text', value: 'a'}] + }), + '[a][]', + 'link reference' + ); + + st.equal( + stringify({ + type: 'imageReference', + identifier: 'a', + alt: 'a' + }), + '![a][]', + 'image reference' + ); + + st.equal( + stringify({ + type: 'footnoteReference', + identifier: 'a' + }), + '[^a]', + 'footnote reference' + ); + + st.end(); + + function stringify(value) { + return String(remark().stringify(value)); + } + }); + t.test('should support `stringLength`', function (st) { st.plan(2); From f84d8fe3dfa4b1047ef620a9a20a34d95eb3cf4c Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Sat, 6 Oct 2018 11:31:51 +0200 Subject: [PATCH 7/7] remark-stringify: use full reference if no type is set --- packages/remark-stringify/lib/util/label.js | 7 +++++-- test/remark-stringify.js | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/remark-stringify/lib/util/label.js b/packages/remark-stringify/lib/util/label.js index cd99211be..e4fe8460e 100644 --- a/packages/remark-stringify/lib/util/label.js +++ b/packages/remark-stringify/lib/util/label.js @@ -10,7 +10,10 @@ module.exports = label; * changes. */ function label(node) { var type = node.referenceType; - var value = type === 'full' ? node.label || node.identifier : ''; - return type === 'shortcut' ? value : '[' + value + ']'; + if (type === 'shortcut') { + return ''; + } + + return type === 'collapsed' ? '[]' : '[' + (node.label || node.identifier) + ']'; } diff --git a/test/remark-stringify.js b/test/remark-stringify.js index eaa54b5f9..9dbaf942a 100644 --- a/test/remark-stringify.js +++ b/test/remark-stringify.js @@ -310,9 +310,9 @@ test('remark().stringify(ast, file)', function (t) { stringify({ type: 'linkReference', identifier: 'a', - children: [{type: 'text', value: 'a'}] + children: [{type: 'text', value: 'b'}] }), - '[a][]', + '[b][a]', 'link reference' ); @@ -320,9 +320,9 @@ test('remark().stringify(ast, file)', function (t) { stringify({ type: 'imageReference', identifier: 'a', - alt: 'a' + alt: 'b' }), - '![a][]', + '![b][a]', 'image reference' );