Skip to content

fix(panel): convert all consecutive alert blockquotes to panels - #8

Open
adamcarlile wants to merge 1 commit into
ajbeck:mainfrom
adamcarlile:main
Open

adamcarlile wants to merge 1 commit into
ajbeck:mainfrom
adamcarlile:main

Conversation

@adamcarlile

Copy link
Copy Markdown

Goldmark's ast.Walk advances siblings via c.NextSibling() after visiting each child. ReplaceChild sets the replaced node's NextSibling to nil, which terminates the walk early and causes subsequent alert blockquotes to remain unconverted.

Split the panelTransformer into a collect phase (read-only walk) and a transform phase (mutate collected nodes) to avoid modifying the tree during traversal.

Goldmark's ast.Walk advances siblings via c.NextSibling() after
visiting each child. ReplaceChild sets the replaced node's
NextSibling to nil, which terminates the walk early and causes
subsequent alert blockquotes to remain unconverted.

Split the panelTransformer into a collect phase (read-only walk)
and a transform phase (mutate collected nodes) to avoid modifying
the tree during traversal.
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.

1 participant