Update the ones related to Element.children (#405)
diff --git a/lib/src/ast.dart b/lib/src/ast.dart
index 25b675b..182fc4c 100644
--- a/lib/src/ast.dart
+++ b/lib/src/ast.dart
@@ -55,7 +55,7 @@
@override
String get textContent {
- return (children ?? []).map((Node? child) => child!.textContent).join('');
+ return (children ?? []).map((child) => child.textContent).join('');
}
}
diff --git a/lib/src/inline_parser.dart b/lib/src/inline_parser.dart
index bdf6612..88896e0 100644
--- a/lib/src/inline_parser.dart
+++ b/lib/src/inline_parser.dart
@@ -285,7 +285,7 @@
// Combine any remaining adjacent Text nodes. This is important to produce
// correct output across newlines, where whitespace is sometimes compressed.
- void _combineAdjacentText(List<Node?> nodes) {
+ void _combineAdjacentText(List<Node> nodes) {
for (var i = 0; i < nodes.length - 1; i++) {
var node = nodes[i];
if (node is Element && node.children != null) {
@@ -294,10 +294,10 @@
}
if (node is Text && nodes[i + 1] is Text) {
var buffer =
- StringBuffer('${node.textContent}${nodes[i + 1]!.textContent}');
+ StringBuffer('${node.textContent}${nodes[i + 1].textContent}');
var j = i + 2;
while (j < nodes.length && nodes[j] is Text) {
- buffer.write(nodes[j]!.textContent);
+ buffer.write(nodes[j].textContent);
j++;
}
nodes[i] = Text(buffer.toString());