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

Fix fuzzing empty list items #669

Merged
merged 4 commits into from Jun 22, 2023

Conversation

mgeisler
Copy link
Collaborator

While playing some more with the fuzzer, I found that the normalize function was buggy: it would turn

Start(List(None))
  Start(Item)
  End(Item)
  Start(Item)
  End(Item)
End(List(false))

into

Start(List(None))
  Start(Item)
    Start(Paragraph)
    End(Item)
    Start(Item)
      Start(Paragraph)
      End(Item)
    End(List(false))

by mistake.

This PR moves the logic to a library (inside the fuzzing crate) so we can test this and perhaps reuse it across different fuzzers.

This allows us to write tests for the non-trivial amount of code in
the fuzzer.
    Start(List(None))
      Start(Item)
      End(Item)
      Start(Item)
      End(Item)
    End(List(false))

would be normalized to

    Start(List(None))
      Start(Item)
        Start(Paragraph)
        End(Item)
        Start(Item)
          Start(Paragraph)
          End(Item)
        End(List(false))

by mistake.
@Martin1887
Copy link
Collaborator

Thanks!, I will try to review it this week.

@mgeisler
Copy link
Collaborator Author

Thanks!, I will try to review it this week.

No stress, this is a fun side project for me! 🙂

@Martin1887 Martin1887 merged commit e7cb701 into pulldown-cmark:master Jun 22, 2023
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants