fix(parse): keep GAP recovery for unclosed bold

Hard-erroring code-shaped `` **… `` broke tests/structure/gap-star-json-body.mq.md; unclosed bold stays Comment so later statements still run.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-14 14:41:51 +08:00
1 parent 6f303ff957
commit c8f41164c5
5 files changed
+2 -52

No files matched your search

-13
View File
@@ -363,19 +363,6 @@ impl<'a> Cursor<'a> {
});
}
// Unclosed code-shaped bold (classified Code so we can diagnose).
if trimmed.starts_with("**")
&& !(trimmed.ends_with("**") && trimmed.len() >= 4)
&& crate::lex::looks_like_bold_code(&trimmed[2..])
{
return Err(Diagnostic::new(
None,
span,
"unclosed bold code: expected closing `**`".to_string(),
)
.into());
}
// v0.3: **…** = code segment (assign / call / expr)
if trimmed.starts_with("**") && trimmed.ends_with("**") && trimmed.len() >= 4 {
let inner = &trimmed[2..trimmed.len() - 2];