You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
馃敶 Block::normalize returns empty Blocks instead of accumulated results
In Block::normalize, after the loop on lines 58-64 finishes, bs is empty (the loop breaks when bs.pop() returns None). Line 67 then returns Blocks({ v: bs, meta }) which is a Blocks with an empty array, silently discarding all normalized child blocks stored in acc. The analogous Inline::normalize at src/cmark/inline.mbt:111 correctly uses the pattern binding is_ => Inlines({ v: is_, meta }) to capture acc, but the block version uses _ => and references the wrong variable.
Comparison with correct Inline::normalize
Block (buggy, line 65-68):
match acc {
[b] => b
_ => Blocks({ v: bs, meta }) // bs is empty!
}
Inline (correct, src/cmark/inline.mbt:109-112):
match acc {
[i] => i
is_ => Inlines({ v: is_, meta }) // is_ binds to acc
}
(Refers to line 67)
Was this helpful? React with 馃憤 or 馃憥 to provide feedback.
馃敶 Block::normalize returns empty Blocks instead of accumulated results
In
Block::normalize, after the loop on lines 58-64 finishes,bsis empty (the loop breaks whenbs.pop()returnsNone). Line 67 then returnsBlocks({ v: bs, meta })which is aBlockswith an empty array, silently discarding all normalized child blocks stored inacc. The analogousInline::normalizeatsrc/cmark/inline.mbt:111correctly uses the pattern bindingis_ => Inlines({ v: is_, meta })to captureacc, but the block version uses_ =>and references the wrong variable.Comparison with correct Inline::normalize
Block (buggy, line 65-68):
Inline (correct,
src/cmark/inline.mbt:109-112):(Refers to line 67)
Was this helpful? React with 馃憤 or 馃憥 to provide feedback.
Originally posted by @devin-ai-integration[bot] in #110 (comment)