test: GH-31 input also panics via to_html (not just to_mdast)#208
Open
ChristianMurphy wants to merge 1 commit intowooorm:test/setext-headingsfrom
Open
test: GH-31 input also panics via to_html (not just to_mdast)#208ChristianMurphy wants to merge 1 commit intowooorm:test/setext-headingsfrom
to_html (not just to_mdast)#208ChristianMurphy wants to merge 1 commit intowooorm:test/setext-headingsfrom
Conversation
This PR's existing test asserts `to_mdast("=\n=\n=\na\n=", ...)`
returns `Ok(_)`; in 1.0.0 release it panics at
`src/to_mdast.rs:189` with `"Cannot push to non-parent"`.
Adds a second assertion that the same input also panics through the
`to_html` path at `src/to_html.rs:197` with `"at least one buffer
should exist"` (the same panic site reported by wooormGH-22).
The two panic sites likely share a root cause: adjacent setext-heading
underlines confuse the resolver, which produces an Exit event without
a matching Enter; the to_mdast path hits the "Cannot push to non-parent"
assertion in tail-stack management, and the to_html path hits the
empty-buffer-stack `expect` in `line_ending_if_needed`. A single
resolver fix should close both this PR and wooormGH-22 together.
Verified to fail against `markdown = "=1.0.0"` in release.
Found via in-tree fuzzing campaign.
Related-to: wooormGH-22.
Related-to: wooormGH-31.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR's existing test asserts
to_mdast("=\n=\n=\na\n=", ...)returnsOk(_); in 1.0.0 release it panics atsrc/to_mdast.rs:189with"Cannot push to non-parent".Adds a second assertion that the same input also panics through the
to_htmlpath atsrc/to_html.rs:197with"at least one buffer should exist"(the same panic site reported by GH-22).The two panic sites likely share a root cause: adjacent setext-heading underlines confuse the resolver, which produces an Exit event without a matching Enter; the to_mdast path hits the "Cannot push to non-parent" assertion in tail-stack management, and the to_html path hits the empty-buffer-stack
expectinline_ending_if_needed. A single resolver fix should close both this PR and GH-22 together.Verified to fail against
markdown = "=1.0.0"in release.Found via in-tree fuzzing campaign.
Related-to: GH-22.
Related-to: GH-31.