diff --git a/CHANGELOG.md b/CHANGELOG.md index 272702d9..6f275c9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## 7.1.2-wip +* Update all CommonMark specification links to 0.30. + ## 7.1.1 * Fix delimiter row matching pattern for tables. diff --git a/README.md b/README.md index 871b54b3..b1c86954 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ compliance with [CommonMark]. 3. Update the stats files as described above. Note any changes in the results. 4. Update any references to the existing spec by search for - `https://spec.commonmark.org/0.28` in the repository. (Including this one.) + `https://spec.commonmark.org/0.30/` in the repository. (Including this one.) Verify the updated links are still valid. 5. Commit changes, including a corresponding note in `CHANGELOG.md`. diff --git a/lib/src/block_syntaxes/fenced_code_block_syntax.dart b/lib/src/block_syntaxes/fenced_code_block_syntax.dart index e4086d61..cea11066 100644 --- a/lib/src/block_syntaxes/fenced_code_block_syntax.dart +++ b/lib/src/block_syntaxes/fenced_code_block_syntax.dart @@ -11,7 +11,8 @@ import 'block_syntax.dart'; /// Parses preformatted code blocks between two ~~~ or ``` sequences. /// -/// See the CommonMark spec: https://spec.commonmark.org/0.29/#fenced-code-blocks +/// See the CommonMark spec: +/// https://spec.commonmark.org/0.30/#fenced-code-blocks class FencedCodeBlockSyntax extends BlockSyntax { @override RegExp get pattern => codeFencePattern; diff --git a/lib/src/block_syntaxes/list_syntax.dart b/lib/src/block_syntaxes/list_syntax.dart index 5ca34514..c911ee70 100644 --- a/lib/src/block_syntaxes/list_syntax.dart +++ b/lib/src/block_syntaxes/list_syntax.dart @@ -35,7 +35,7 @@ abstract class ListSyntax extends BlockSyntax { @override bool canEndBlock(BlockParser parser) { // An empty list cannot interrupt a paragraph. See - // https://spec.commonmark.org/0.29/#example-255. + // https://spec.commonmark.org/0.30/#example-285. // Ideally, [BlockSyntax.canEndBlock] should be changed to be a method // which accepts a [BlockParser], but this would be a breaking change, // so we're going with this temporarily. @@ -43,7 +43,7 @@ abstract class ListSyntax extends BlockSyntax { // Allow only lists starting with 1 to interrupt paragraphs, if it is an // ordered list. See https://spec.commonmark.org/0.30/#example-304. - // But there shuold be an exception for nested ordered lists, for example: + // But there should be an exception for nested ordered lists, for example: // ``` // 1. one // 2. two @@ -276,7 +276,7 @@ abstract class ListSyntax extends BlockSyntax { } // Must strip paragraph tags if the list is "tight". - // http://spec.commonmark.org/0.28/#lists + // https://spec.commonmark.org/0.30/#lists final listIsTight = !anyEmptyLines && !anyEmptyLinesBetweenBlocks; if (listIsTight) { diff --git a/lib/src/document.dart b/lib/src/document.dart index e68579a2..b04fa072 100644 --- a/lib/src/document.dart +++ b/lib/src/document.dart @@ -191,19 +191,19 @@ extension _ElementExt on Element { } /// A [link reference -/// definition](http://spec.commonmark.org/0.28/#link-reference-definitions). +/// definition](https://spec.commonmark.org/0.30/#link-reference-definitions). class LinkReference { - /// The [link label](http://spec.commonmark.org/0.28/#link-label). + /// The [link label](https://spec.commonmark.org/0.30/#link-label). /// /// Temporarily, this class is also being used to represent the link data for /// an inline link (the destination and title), but this should change before /// the package is released. final String label; - /// The [link destination](http://spec.commonmark.org/0.28/#link-destination). + /// The [link destination](https://spec.commonmark.org/0.30/#link-destination). final String destination; - /// The [link title](http://spec.commonmark.org/0.28/#link-title). + /// The [link title](https://spec.commonmark.org/0.30/#link-title). final String? title; /// Construct a new [LinkReference], with all necessary fields. diff --git a/lib/src/inline_parser.dart b/lib/src/inline_parser.dart index 27ab6952..e700ecfd 100644 --- a/lib/src/inline_parser.dart +++ b/lib/src/inline_parser.dart @@ -100,7 +100,7 @@ class InlineParser { while (!isDone) { // A right bracket (']') is special. Hitting this character triggers the // "look for link or image" procedure. - // See https://spec.commonmark.org/0.29/#an-algorithm-for-parsing-nested-emphasis-and-links. + // See https://spec.commonmark.org/0.30/#an-algorithm-for-parsing-nested-emphasis-and-links. if (charAt(pos) == $rbracket) { writeText(); _linkOrImage(); @@ -125,7 +125,7 @@ class InlineParser { /// image. /// /// This is the "look for link or image" routine from the CommonMark spec: - /// https://spec.commonmark.org/0.29/#-look-for-link-or-image-. + /// https://spec.commonmark.org/0.30/#look-for-link-or-image. void _linkOrImage() { final index = _delimiterStack .lastIndexWhere((d) => d.char == $lbracket || d.char == $exclamation); diff --git a/lib/src/inline_syntaxes/delimiter_syntax.dart b/lib/src/inline_syntaxes/delimiter_syntax.dart index 5a7437a4..f26bdc9b 100644 --- a/lib/src/inline_syntaxes/delimiter_syntax.dart +++ b/lib/src/inline_syntaxes/delimiter_syntax.dart @@ -13,7 +13,7 @@ class DelimiterSyntax extends InlineSyntax { /// Whether this is parsed according to the same nesting rules as [emphasis /// delimiters][]. /// - /// [emphasis delimiters]: http://spec.commonmark.org/0.28/#can-open-emphasis + /// [emphasis delimiters]: https://spec.commonmark.org/0.30/#can-open-emphasis final bool requiresDelimiterRun; /// Whether to allow intra-word delimiter runs. CommonMark emphasis and @@ -302,14 +302,14 @@ class DelimiterRun implements Delimiter { } // If it is a left-flanking delimiter run, see - // http://spec.commonmark.org/0.30/#left-flanking-delimiter-run. + // https://spec.commonmark.org/0.30/#left-flanking-delimiter-run. final isLeftFlanking = !followedByWhitespace && (!followedByPunctuation || precededByWhitespace || precededByPunctuation); // If it is a right-flanking delimiter run, see - // http://spec.commonmark.org/0.30/#right-flanking-delimiter-run. + // https://spec.commonmark.org/0.30/#right-flanking-delimiter-run. final isRightFlanking = !precededByWhitespace && (!precededByPunctuation || followedByWhitespace || diff --git a/lib/src/inline_syntaxes/email_autolink_syntax.dart b/lib/src/inline_syntaxes/email_autolink_syntax.dart index e7b90ff1..212f1a49 100644 --- a/lib/src/inline_syntaxes/email_autolink_syntax.dart +++ b/lib/src/inline_syntaxes/email_autolink_syntax.dart @@ -10,7 +10,7 @@ import 'inline_syntax.dart'; /// Matches autolinks like ``. /// -/// See . +/// See . class EmailAutolinkSyntax extends InlineSyntax { static const _email = r'''[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}''' diff --git a/lib/src/inline_syntaxes/inline_html_syntax.dart b/lib/src/inline_syntaxes/inline_html_syntax.dart index fb5b528e..3a7ce77d 100644 --- a/lib/src/inline_syntaxes/inline_html_syntax.dart +++ b/lib/src/inline_syntaxes/inline_html_syntax.dart @@ -7,7 +7,7 @@ import '../charcode.dart'; import '../patterns.dart'; /// Leave inline HTML tags alone, from -/// [CommonMark 0.30](http://spec.commonmark.org/0.30/#raw-html). +/// [CommonMark 0.30](https://spec.commonmark.org/0.30/#raw-html). /// /// This is not actually a good definition (nor CommonMark's) of an HTML tag, /// but it is fast. It will leave text like `