Skip to content

Commit 2cd044e

Browse files
committed
Fix Bad State error when setting a ul to have an ol list type
1 parent 0874d55 commit 2cd044e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/html_parser.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,9 @@ class HtmlParser extends StatelessWidget {
553553
tree.style.markerContent = '•';
554554
break;
555555
case ListStyleType.DECIMAL:
556+
if (olStack.isEmpty) {
557+
olStack.add(Context((tree.attributes['start'] != null ? int.tryParse(tree.attributes['start'] ?? "") ?? 1 : 1) - 1));
558+
}
556559
olStack.last.data += 1;
557560
tree.style.markerContent = '${olStack.last.data}.';
558561
break;

0 commit comments

Comments
 (0)