Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash "Bad state: No element" in AlertBlockSyntax.parseChildLines #584

Closed
jonasfj opened this issue Feb 22, 2024 · 1 comment · Fixed by #593
Closed

Crash "Bad state: No element" in AlertBlockSyntax.parseChildLines #584

jonasfj opened this issue Feb 22, 2024 · 1 comment · Fixed by #593
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@jonasfj
Copy link
Member

jonasfj commented Feb 22, 2024

I ran test/crash_test.dart and found 9 markdown files where package:markdown crashes:

Bad state: No element
#0      List.last (dart:core-patch/growable_array.dart:348:5)
#1      AlertBlockSyntax.parseChildLines (package:markdown/src/block_syntaxes/alert_block_syntax.dart:54:35)
#2      AlertBlockSyntax.parse (package:markdown/src/block_syntaxes/alert_block_syntax.dart:85:24)
#3      BlockParser.parseLines (package:markdown/src/block_parser.dart:178:32)
#4      Document.parseLineList (package:markdown/src/document.dart:87:44)
#5      Document.parse (package:markdown/src/document.dart:83:36)
#6      markdownToHtml (package:markdown/src/html_renderer.dart:40:26)

Full log in: https://gist.github.com/jonasfj/9d8dfb702f46e64b78a22f5762ac2f95

This ran a scan of all .md files in the latest version of all packages on pub.dev.


@AlexV525, @devoncarew, could this be related to:

@jonasfj jonasfj added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Feb 22, 2024
@AlexV525
Copy link
Contributor

@jonasfj Thanks for the report. Unfortunately, I'm doing other work which occupied most of my time so I cannot respond to this in recent days. I can look into this when I'm available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants