fix(parse): diagnose unclosed code-shaped bold

Treat `` **x = 1 `` as Code and error with a clear unclosed-`**` diagnostic instead of silently skipping it as a comment.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-14 14:39:58 +08:00
1 parent 95a49697f7
commit 6f303ff957
6 files changed
+86 -30

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
---
title: unclosed bold code
description: code-shaped `**…` without closing `**` must diagnose
---
# main
**x = 1
+9
View File
@@ -610,6 +610,15 @@ fn error_syntax_bad_line() {
);
}
#[test]
fn error_unclosed_bold() {
assert_err(
"tests/errors/unclosed-bold.mq.md",
"8:1",
"unclosed bold code",
);
}
#[test]
fn error_div_zero() {
assert_err("tests/errors/div-zero.mq.md", "7:1", "division by zero");