fix a crash when parsing alert block syntax (dart-lang/markdown#593)

* fix a crash when parsing alert block syntax

* update version.dart

* Remove the reference to 'parser.lines' in canParse().
diff --git a/pkgs/markdown/CHANGELOG.md b/pkgs/markdown/CHANGELOG.md
index 55760bf..f7859d4 100644
--- a/pkgs/markdown/CHANGELOG.md
+++ b/pkgs/markdown/CHANGELOG.md
@@ -1,5 +1,7 @@
-## 7.2.2-wip
+## 7.2.2
 
+* Fix a crash parsing alert block syntax (#584).
+* Have alert block syntax support multiple paragraphs (#577).
 * Require Dart `^3.2.0`.
 
 ## 7.2.1
diff --git a/pkgs/markdown/lib/src/block_syntaxes/alert_block_syntax.dart b/pkgs/markdown/lib/src/block_syntaxes/alert_block_syntax.dart
index 5428604..0f4f5b1 100644
--- a/pkgs/markdown/lib/src/block_syntaxes/alert_block_syntax.dart
+++ b/pkgs/markdown/lib/src/block_syntaxes/alert_block_syntax.dart
@@ -21,8 +21,7 @@
 
   @override
   bool canParse(BlockParser parser) {
-    return pattern.hasMatch(parser.current.content) &&
-        parser.lines.any((line) => _contentLineRegExp.hasMatch(line.content));
+    return alertPattern.hasMatch(parser.current.content);
   }
 
   /// Whether this alert ends with a lazy continuation line.
@@ -39,9 +38,9 @@
     _lazyContinuation = false;
 
     while (!parser.isDone) {
-      final strippedContent =
-          parser.current.content.replaceFirst(RegExp(r'^\s*>?\s*'), '');
-      final match = strippedContent.isEmpty
+      final lineContent = parser.current.content.trimLeft();
+      final strippedContent = lineContent.replaceFirst(RegExp(r'^>?\s*'), '');
+      final match = strippedContent.isEmpty && !lineContent.startsWith('>')
           ? null
           : _contentLineRegExp.firstMatch(strippedContent);
       if (match != null) {
@@ -51,7 +50,7 @@
         continue;
       }
 
-      final lastLine = childLines.last;
+      final lastLine = childLines.isEmpty ? Line('') : childLines.last;
 
       // A paragraph continuation is OK. This is content that cannot be parsed
       // as any other syntax except Paragraph, and it doesn't match the bar in
diff --git a/pkgs/markdown/lib/src/patterns.dart b/pkgs/markdown/lib/src/patterns.dart
index 4899ea1..2690419 100644
--- a/pkgs/markdown/lib/src/patterns.dart
+++ b/pkgs/markdown/lib/src/patterns.dart
@@ -153,9 +153,9 @@
 final linkReferenceDefinitionPattern = RegExp(r'^[ ]{0,3}\[');
 
 /// Alert type patterns.
-/// A alert block is similar to a blockquote,
-/// starts with `> [!TYPE]`, and only 5 types are supported
-/// with case-insensitive.
+///
+/// A alert block is similar to a blockquote, starts with `> [!TYPE]`, and only
+/// 5 types are supported (case-insensitive).
 final alertPattern = RegExp(
   r'^\s{0,3}>\s{0,3}\\?\[!(note|tip|important|caution|warning)\\?\]\s*$',
   caseSensitive: false,
diff --git a/pkgs/markdown/lib/src/version.dart b/pkgs/markdown/lib/src/version.dart
index b0cf861..f10c4ff 100644
--- a/pkgs/markdown/lib/src/version.dart
+++ b/pkgs/markdown/lib/src/version.dart
@@ -1,2 +1,2 @@
 // Generated code. Do not modify.
-const packageVersion = '7.2.2-wip';
+const packageVersion = '7.2.2';
diff --git a/pkgs/markdown/pubspec.yaml b/pkgs/markdown/pubspec.yaml
index bd85b65..7cb8b6f 100644
--- a/pkgs/markdown/pubspec.yaml
+++ b/pkgs/markdown/pubspec.yaml
@@ -1,9 +1,9 @@
 name: markdown
-version: 7.2.2-wip
-
+version: 7.2.2
 description: >-
   A portable Markdown library written in Dart that can parse Markdown into HTML.
 repository: https://github.com/dart-lang/markdown
+
 topics:
  - markdown
 
diff --git a/pkgs/markdown/test/extensions/alert_extension.unit b/pkgs/markdown/test/extensions/alert_extension.unit
index 0f422b5..9a21f18 100644
--- a/pkgs/markdown/test/extensions/alert_extension.unit
+++ b/pkgs/markdown/test/extensions/alert_extension.unit
@@ -129,3 +129,34 @@
 with two lines.</p>
 </div>
 <p>Additional markdown text.</p>
+>>> supports continuation lines
+> [!note]
+> A sample note
+with two lines.
+
+Additional markdown text.
+<<<
+<div class="markdown-alert markdown-alert-note">
+<p class="markdown-alert-title">Note</p>
+<p>A sample note
+with two lines.</p>
+</div>
+<p>Additional markdown text.</p>
+>>> crash repro #584.1
+> [!Warning]
+>
+> Some extensions won't work on dynamic types.
+<<<
+<div class="markdown-alert markdown-alert-warning">
+<p class="markdown-alert-title">Warning</p>
+<p>Some extensions won't work on dynamic types.</p>
+</div>
+>>> crash repro #584.2
+> [!NOTE]
+> 
+> if you receive the following error:
+<<<
+<div class="markdown-alert markdown-alert-note">
+<p class="markdown-alert-title">Note</p>
+<p>if you receive the following error:</p>
+</div>