fix: float wire precision, native stack safety, refs diagnostics and fixtures

Findings from the conformance corpus workstream, all fixed at the source:

- value/wire: enable serde_json's float_roundtrip so typed wire floats keep
  their exact digits across foreign/plugin boundaries (Python pi*9 now stays
  28.274333882308138).
- host: default interpreter stack budget lowered to 128 frames so deeply
  recursive documents hit a structured resource.exhausted instead of exhausting
  the native debug-build Rust stack; --stack remains available.
- frontend/map: calling an external HTTP(S) link is reported as ref.unresolved
  (consistent with other unresolvable call targets) instead of math.unsupported.
- frontend/analyze: invalid front matter emits a single frontmatter.invalid
  diagnostic (the YAML error is not repeated by the imports pass).
- spec/mapping: clarify that would-be execution nodes outside any function body
  are inert with a markdown.inert_executable warning (no "return outside a
  function" hard-error claim).
- tests: add the conformance corpus and harness (150 AST goldens, 36 semantic
  goldens, 48 hard-error + 6 warning + 10 runtime-error negatives, CLI/module/
  plugin integration tests, prose-invariance properties) and update the
  three reported observations to the fixed behaviour.
This commit is contained in:
cflmy committed 2026-11-20 10:54:16 +08:00
1 parent 33341a0e92
commit 847c2c1580
511 files changed
+11678 -26

No files matched your search

+167
View File
@@ -0,0 +1,167 @@
# Marqdo conformance and integration test corpus
This directory holds the P0/P1 conformance corpus required by
`docs/DEVELOPMENT_BLUEPRINT.md` §13/§14. The Rust harnesses live in
`crates/cli/tests/` (they use the workspace libraries directly and the
`marqdo` binary via `CARGO_BIN_EXE_marqdo`); the fixtures are plain files here
so they can be rendered, diffed and reviewed like Markdown documents.
Everything here is data. Nothing in this directory modifies the repository, and
no test commits, copies or rewrites files outside a throw-away temp directory.
## Layout
```text
tests/
├── conformance/
│ ├── ast/ 150 × *.mq.md + sibling *.ast.json goldens
│ └── semantics/ 36 × *.mq.md + sibling *.expected.json goldens
├── negative/
│ ├── *.mq.md 48 × compile-time hard-error fixtures + *.expected.json
│ ├── warnings/ 6 × inert-executable warning fixtures + *.expected.json
│ └── runtime/ 10 × runtime-error fixtures + *.expected.json
└── README.md this file
```
Rust harnesses (all in `crates/cli/tests/`):
| Harness | What it proves |
|---|---|
| `conformance_ast.rs` | The frozen `marqdo.md.v1` profile parses each fixture into exactly the checked-in AST (node kinds, attributes, literals, byte spans, order). |
| `conformance_semantics.rs` | Each semantic fixture compiles through `marqdo_frontend`, is assembled into `marqdo_ir::Program` and executed with `marqdo_runtime` + `marqdo_host::StdHost`; returned wire value and program stdout match. |
| `negative.rs` | Invalid executable shapes are **hard errors** (never prose fallbacks), exact sorted diagnostic-code lists; warnings and runtime error codes are asserted in their own suites. |
| `properties.rs` | Blueprint §14.2 prose invariance: inserting/removing pure narration paragraphs never changes the executable function IR (modulo source spans) and diagnostics stay error-free. |
| `integration_cli.rs` | Real CLI contract: `init`, `check`, `run`, `call`, `inspect`, `fmt`, multi-module imports/cycles, `lock`/`sync --locked`, plugin inspection and explicitly trusted plugin invocation. |
## Running
Use the workspace cargo cache/target as documented in `AGENTS.md`:
```bash
export PATH=/root/.cargo/bin:$PATH
export CARGO_HOME=/root/work/marqdo-cli/.cache/cargo
export CARGO_TARGET_DIR=/root/work/marqdo-cli/.cache/target
cargo test -p marqdo-cli # all conformance + integration harnesses
cargo test --workspace # whole workspace (includes crate unit tests)
```
Individual harnesses:
```bash
cargo test -p marqdo-cli --test conformance_ast
cargo test -p marqdo-cli --test conformance_semantics
cargo test -p marqdo-cli --test negative
cargo test -p marqdo-cli --test properties
cargo test -p marqdo-cli --test integration_cli
```
Fixture discovery is directory-based and sorted by file name, so the order is
deterministic on every platform. The AST and semantic suites fail loudly if the
corpus shrinks below 100 / 25 fixtures, and the negative suite fails below 30
compile-time hard-error fixtures.
## AST goldens and `UPDATE_GOLDENS`
`*.ast.json` files are the pretty-printed canonical AST view
(`marqdo_markdown::parse(source).root`), exactly as `marqdo inspect --ast --json`
would print it. They pin parser version, extension flags and span arithmetic.
Regenerate **only** for an intentional, ADR-backed profile change (the profile
is frozen in `spec/markdown-profile.md`):
```bash
UPDATE_GOLDENS=1 cargo test -p marqdo-cli --test conformance_ast
```
The update run rewrites every golden, prints how many it rewrote and **passes**.
Re-run without the variable to verify, and review the golden diff: a golden
change is a language change, not a bug fix.
A fixture without a golden is an error, and a golden without a fixture is an
error (stale corpus output), so add/remove both together.
## Semantic goldens
Each `*.expected.json` has the shape:
```json
{
"function": "<name passed to marqdo_runtime::run>",
"args": { "<name>": <wire value> },
"value": <wire value>,
"stdout": "..."
}
```
* `args` and `value` use the typed wire encoding from `marqdo_value::to_wire`
(`{"type":"int","decimal":"42"}`, `{"type":"text","value":"…"}`, …).
* `stdout` is the program output captured from the host (never diagnostics).
* Optional `"grants": ["foreign"]` enables `foreign.call`; that fixture is
skipped with a printed notice when `python3` is unavailable.
All values were produced by running the implementation and then checked by
hand against the fixture source. `UPDATE_SEMANTICS_GOLDENS=1` exists for
authoring convenience, but it must not be used blindly: rewriting a semantic
golden without verifying the value would defeat the purpose of the corpus.
## Negative fixtures
Compile-time (`tests/negative/*.mq.md`):
```json
{"codes": ["markdown.invalid_construct"]}
```
The expected list is the exact sorted multiset of **error** diagnostic codes
produced by `marqdo_frontend::analyze_source`. Warnings emitted by the same
document are ignored here. Every listed code is additionally asserted to have
`error` severity, and every fixture must produce at least one error — invalid
executable shapes never fall back to prose.
Warnings (`tests/negative/warnings/*.mq.md`):
```json
{"severity": "warning", "codes": ["markdown.inert_executable"]}
```
These documents must compile **without errors**; the sorted multiset of warning
codes must match exactly. `return`/`strong`/lists/block quotes outside a
function body are inert content (warning), not hard errors.
Runtime (`tests/negative/runtime/*.mq.md`):
```json
{"function": "main", "args": {}, "codes": ["runtime.division_by_zero"]}
```
These documents compile, then must fail at runtime with the expected stable
error code. Optional keys: `"grants": ["foreign"]` and `"stack_limit": 24`
(used for the recursion-depth fixture so the budget — not the host process
stack — is what fails).
## CLI integration notes
`integration_cli.rs` never leaves the repository dirty:
* temporary projects are created under `std::env::temp_dir()` and removed on
drop;
* the demo C plugin is built **in a temp copy** of `examples/plugin-demo`
(`cc -shared -fPIC -I <repo>/include`), and the `sha256` in the copied
`plugin.yaml` is refreshed there. The repo copy and its `.so` (gitignored) are
never touched;
* tests that need `python3` or `cc` print a skip notice and return when the tool
is unavailable.
## Notes discovered while authoring (all since fixed)
The fixtures initially pinned three observations that were reported and then
fixed in the implementation; the goldens below reflect the fixed behaviour:
* wire floats round-trip exactly (`serde_json/float_roundtrip` is enabled), so
Python `math.pi * 9` keeps `28.274333882308138`;
* the default interpreter stack budget is 128 frames so a deeply recursive
document returns a structured `resource.exhausted` instead of exhausting the
native debug-build stack (`--stack` can raise it deliberately);
* an external-link call form (`> [x](https://example.com)()`) is rejected with
`ref.unresolved`, the same code used for other unresolvable call targets.
+28
View File
@@ -0,0 +1,28 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 14
},
"children": [
{
"kind": "heading",
"level": 1,
"setext": false,
"span": {
"start": 0,
"end": 14
},
"children": [
{
"kind": "text",
"span": {
"start": 2,
"end": 14
},
"literal": "一级标题"
}
]
}
]
}
+1
View File
@@ -0,0 +1 @@
# 一级标题
+28
View File
@@ -0,0 +1,28 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 15
},
"children": [
{
"kind": "heading",
"level": 2,
"setext": false,
"span": {
"start": 0,
"end": 15
},
"children": [
{
"kind": "text",
"span": {
"start": 3,
"end": 15
},
"literal": "二级标题"
}
]
}
]
}
+1
View File
@@ -0,0 +1 @@
## 二级标题
+28
View File
@@ -0,0 +1,28 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 16
},
"children": [
{
"kind": "heading",
"level": 3,
"setext": false,
"span": {
"start": 0,
"end": 16
},
"children": [
{
"kind": "text",
"span": {
"start": 4,
"end": 16
},
"literal": "三级标题"
}
]
}
]
}
+1
View File
@@ -0,0 +1 @@
### 三级标题
+28
View File
@@ -0,0 +1,28 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 17
},
"children": [
{
"kind": "heading",
"level": 4,
"setext": false,
"span": {
"start": 0,
"end": 17
},
"children": [
{
"kind": "text",
"span": {
"start": 5,
"end": 17
},
"literal": "四级标题"
}
]
}
]
}
+1
View File
@@ -0,0 +1 @@
#### 四级标题
+28
View File
@@ -0,0 +1,28 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 18
},
"children": [
{
"kind": "heading",
"level": 5,
"setext": false,
"span": {
"start": 0,
"end": 18
},
"children": [
{
"kind": "text",
"span": {
"start": 6,
"end": 18
},
"literal": "五级标题"
}
]
}
]
}
+1
View File
@@ -0,0 +1 @@
##### 五级标题
+28
View File
@@ -0,0 +1,28 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 19
},
"children": [
{
"kind": "heading",
"level": 6,
"setext": false,
"span": {
"start": 0,
"end": 19
},
"children": [
{
"kind": "text",
"span": {
"start": 7,
"end": 19
},
"literal": "六级标题"
}
]
}
]
}
+1
View File
@@ -0,0 +1 @@
###### 六级标题
@@ -0,0 +1,28 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 12
},
"children": [
{
"kind": "heading",
"level": 2,
"setext": false,
"span": {
"start": 0,
"end": 12
},
"children": [
{
"kind": "text",
"span": {
"start": 3,
"end": 9
},
"literal": "函数"
}
]
}
]
}
@@ -0,0 +1 @@
## 函数 ##
@@ -0,0 +1,28 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 21
},
"children": [
{
"kind": "heading",
"level": 1,
"setext": true,
"span": {
"start": 0,
"end": 21
},
"children": [
{
"kind": "text",
"span": {
"start": 0,
"end": 12
},
"literal": "一级标题"
}
]
}
]
}
@@ -0,0 +1,2 @@
一级标题
========
@@ -0,0 +1,28 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 21
},
"children": [
{
"kind": "heading",
"level": 2,
"setext": true,
"span": {
"start": 0,
"end": 21
},
"children": [
{
"kind": "text",
"span": {
"start": 0,
"end": 12
},
"literal": "函数标题"
}
]
}
]
}
@@ -0,0 +1,2 @@
函数标题
--------
@@ -0,0 +1,47 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 25
},
"children": [
{
"kind": "heading",
"level": 1,
"setext": false,
"span": {
"start": 0,
"end": 8
},
"children": [
{
"kind": "text",
"span": {
"start": 2,
"end": 8
},
"literal": "数学"
}
]
},
{
"kind": "heading",
"level": 2,
"setext": false,
"span": {
"start": 10,
"end": 25
},
"children": [
{
"kind": "text",
"span": {
"start": 13,
"end": 25
},
"literal": "阶乘计算"
}
]
}
]
}
@@ -0,0 +1,3 @@
# 数学
## 阶乘计算
@@ -0,0 +1,28 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 20
},
"children": [
{
"kind": "heading",
"level": 1,
"setext": false,
"span": {
"start": 0,
"end": 20
},
"children": [
{
"kind": "text",
"span": {
"start": 2,
"end": 20
},
"literal": "统计 📊 报告"
}
]
}
]
}
@@ -0,0 +1 @@
# 统计 📊 报告
@@ -0,0 +1,35 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 13
},
"children": [
{
"kind": "heading",
"level": 2,
"setext": false,
"span": {
"start": 0,
"end": 5
}
},
{
"kind": "paragraph",
"span": {
"start": 7,
"end": 13
},
"children": [
{
"kind": "text",
"span": {
"start": 7,
"end": 13
},
"literal": "正文"
}
]
}
]
}
@@ -0,0 +1,3 @@
##
正文
@@ -0,0 +1,70 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 33
},
"children": [
{
"kind": "heading",
"level": 2,
"setext": false,
"span": {
"start": 0,
"end": 33
},
"children": [
{
"kind": "strong",
"span": {
"start": 3,
"end": 13
},
"children": [
{
"kind": "text",
"span": {
"start": 5,
"end": 11
},
"literal": "加粗"
}
]
},
{
"kind": "text",
"span": {
"start": 13,
"end": 18
},
"literal": " 与 "
},
{
"kind": "emph",
"span": {
"start": 18,
"end": 26
},
"children": [
{
"kind": "text",
"span": {
"start": 19,
"end": 25
},
"literal": "斜体"
}
]
},
{
"kind": "text",
"span": {
"start": 26,
"end": 33
},
"literal": " 标题"
}
]
}
]
}
@@ -0,0 +1 @@
## **加粗** 与 *斜体* 标题
@@ -0,0 +1,37 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 22
},
"children": [
{
"kind": "block_quote",
"span": {
"start": 0,
"end": 22
},
"children": [
{
"kind": "heading",
"level": 1,
"setext": false,
"span": {
"start": 2,
"end": 22
},
"children": [
{
"kind": "text",
"span": {
"start": 4,
"end": 22
},
"literal": "引用中的标题"
}
]
}
]
}
]
}
@@ -0,0 +1 @@
> # 引用中的标题
@@ -0,0 +1,48 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 23
},
"children": [
{
"kind": "list",
"ordered": false,
"tight": true,
"span": {
"start": 0,
"end": 23
},
"children": [
{
"kind": "item",
"span": {
"start": 0,
"end": 23
},
"children": [
{
"kind": "heading",
"level": 2,
"setext": false,
"span": {
"start": 2,
"end": 23
},
"children": [
{
"kind": "text",
"span": {
"start": 5,
"end": 23
},
"literal": "列表中的标题"
}
]
}
]
}
]
}
]
}
@@ -0,0 +1 @@
- ## 列表中的标题
@@ -0,0 +1,19 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 30
},
"children": [
{
"kind": "code_block",
"fenced": true,
"info": "markdown",
"span": {
"start": 0,
"end": 30
},
"literal": "# 不是标题\n"
}
]
}
@@ -0,0 +1,3 @@
```markdown
# 不是标题
```
@@ -0,0 +1,28 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 23
},
"children": [
{
"kind": "heading",
"level": 2,
"setext": false,
"span": {
"start": 0,
"end": 23
},
"children": [
{
"kind": "text",
"span": {
"start": 5,
"end": 21
},
"literal": "多个 空格"
}
]
}
]
}
@@ -0,0 +1 @@
## 多个 空格
@@ -0,0 +1,66 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 49
},
"children": [
{
"kind": "heading",
"level": 1,
"setext": false,
"span": {
"start": 0,
"end": 14
},
"children": [
{
"kind": "text",
"span": {
"start": 2,
"end": 14
},
"literal": "命名空间"
}
]
},
{
"kind": "heading",
"level": 3,
"setext": false,
"span": {
"start": 16,
"end": 38
},
"children": [
{
"kind": "text",
"span": {
"start": 20,
"end": 38
},
"literal": "直接跳到三级"
}
]
},
{
"kind": "heading",
"level": 2,
"setext": false,
"span": {
"start": 40,
"end": 49
},
"children": [
{
"kind": "text",
"span": {
"start": 43,
"end": 49
},
"literal": "函数"
}
]
}
]
}
@@ -0,0 +1,5 @@
# 命名空间
### 直接跳到三级
## 函数
@@ -0,0 +1,26 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 30
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 30
},
"children": [
{
"kind": "text",
"span": {
"start": 0,
"end": 30
},
"literal": "一段普通的中文叙述。"
}
]
}
]
}
@@ -0,0 +1 @@
一段普通的中文叙述。
@@ -0,0 +1,56 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 47
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 47
},
"children": [
{
"kind": "text",
"span": {
"start": 0,
"end": 15
},
"literal": "第一行叙述"
},
{
"kind": "soft_break",
"span": {
"start": 15,
"end": 16
}
},
{
"kind": "text",
"span": {
"start": 16,
"end": 31
},
"literal": "第二行叙述"
},
{
"kind": "soft_break",
"span": {
"start": 31,
"end": 32
}
},
{
"kind": "text",
"span": {
"start": 32,
"end": 47
},
"literal": "第三行叙述"
}
]
}
]
}
@@ -0,0 +1,3 @@
第一行叙述
第二行叙述
第三行叙述
@@ -0,0 +1,41 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 21
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 21
},
"children": [
{
"kind": "text",
"span": {
"start": 0,
"end": 9
},
"literal": "第一行"
},
{
"kind": "line_break",
"span": {
"start": 9,
"end": 12
}
},
{
"kind": "text",
"span": {
"start": 12,
"end": 21
},
"literal": "第二行"
}
]
}
]
}
@@ -0,0 +1,2 @@
第一行
第二行
@@ -0,0 +1,41 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 20
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 20
},
"children": [
{
"kind": "text",
"span": {
"start": 0,
"end": 9
},
"literal": "第一行"
},
{
"kind": "line_break",
"span": {
"start": 9,
"end": 11
}
},
{
"kind": "text",
"span": {
"start": 11,
"end": 20
},
"literal": "第二行"
}
]
}
]
}
@@ -0,0 +1,2 @@
第一行\
第二行
@@ -0,0 +1,7 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 0
}
}
Whitespace-only changes.
@@ -0,0 +1,7 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 5
}
}
@@ -0,0 +1,3 @@
@@ -0,0 +1,45 @@
{
"kind": "document",
"span": {
"start": 3,
"end": 30
},
"children": [
{
"kind": "heading",
"level": 1,
"setext": false,
"span": {
"start": 3,
"end": 22
},
"children": [
{
"kind": "text",
"span": {
"start": 5,
"end": 22
},
"literal": "带 BOM 的文档"
}
]
},
{
"kind": "paragraph",
"span": {
"start": 24,
"end": 30
},
"children": [
{
"kind": "text",
"span": {
"start": 24,
"end": 30
},
"literal": "正文"
}
]
}
]
}
@@ -0,0 +1,3 @@
# 带 BOM 的文档
正文
@@ -0,0 +1,62 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 43
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 15
},
"children": [
{
"kind": "text",
"span": {
"start": 0,
"end": 15
},
"literal": "引言段落。"
}
]
},
{
"kind": "heading",
"level": 2,
"setext": false,
"span": {
"start": 17,
"end": 26
},
"children": [
{
"kind": "text",
"span": {
"start": 20,
"end": 26
},
"literal": "函数"
}
]
},
{
"kind": "paragraph",
"span": {
"start": 28,
"end": 43
},
"children": [
{
"kind": "text",
"span": {
"start": 28,
"end": 43
},
"literal": "正文段落。"
}
]
}
]
}
@@ -0,0 +1,5 @@
引言段落。
## 函数
正文段落。
@@ -0,0 +1,35 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 10
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 10
},
"children": [
{
"kind": "strong",
"span": {
"start": 0,
"end": 10
},
"children": [
{
"kind": "text",
"span": {
"start": 2,
"end": 8
},
"literal": "粗体"
}
]
}
]
}
]
}
@@ -0,0 +1 @@
**粗体**
@@ -0,0 +1,35 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 10
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 10
},
"children": [
{
"kind": "strong",
"span": {
"start": 0,
"end": 10
},
"children": [
{
"kind": "text",
"span": {
"start": 2,
"end": 8
},
"literal": "粗体"
}
]
}
]
}
]
}
@@ -0,0 +1 @@
__粗体__
@@ -0,0 +1,35 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 8
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 8
},
"children": [
{
"kind": "emph",
"span": {
"start": 0,
"end": 8
},
"children": [
{
"kind": "text",
"span": {
"start": 1,
"end": 7
},
"literal": "斜体"
}
]
}
]
}
]
}
@@ -0,0 +1 @@
*斜体*
@@ -0,0 +1,35 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 8
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 8
},
"children": [
{
"kind": "emph",
"span": {
"start": 0,
"end": 8
},
"children": [
{
"kind": "text",
"span": {
"start": 1,
"end": 7
},
"literal": "斜体"
}
]
}
]
}
]
}
@@ -0,0 +1 @@
_斜体_
@@ -0,0 +1,44 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 15
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 15
},
"children": [
{
"kind": "emph",
"span": {
"start": 0,
"end": 15
},
"children": [
{
"kind": "strong",
"span": {
"start": 1,
"end": 14
},
"children": [
{
"kind": "text",
"span": {
"start": 3,
"end": 12
},
"literal": "粗斜体"
}
]
}
]
}
]
}
]
}
@@ -0,0 +1 @@
***粗斜体***
@@ -0,0 +1,60 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 32
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 32
},
"children": [
{
"kind": "strong",
"span": {
"start": 0,
"end": 32
},
"children": [
{
"kind": "text",
"span": {
"start": 2,
"end": 15
},
"literal": "粗体中的 "
},
{
"kind": "emph",
"span": {
"start": 15,
"end": 23
},
"children": [
{
"kind": "text",
"span": {
"start": 16,
"end": 22
},
"literal": "斜体"
}
]
},
{
"kind": "text",
"span": {
"start": 23,
"end": 30
},
"literal": " 文本"
}
]
}
]
}
]
}
@@ -0,0 +1 @@
**粗体中的 *斜体* 文本**
@@ -0,0 +1,60 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 32
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 32
},
"children": [
{
"kind": "emph",
"span": {
"start": 0,
"end": 32
},
"children": [
{
"kind": "text",
"span": {
"start": 1,
"end": 14
},
"literal": "斜体中的 "
},
{
"kind": "strong",
"span": {
"start": 14,
"end": 24
},
"children": [
{
"kind": "text",
"span": {
"start": 16,
"end": 22
},
"literal": "粗体"
}
]
},
{
"kind": "text",
"span": {
"start": 24,
"end": 31
},
"literal": " 文本"
}
]
}
]
}
]
}
@@ -0,0 +1 @@
*斜体中的 **粗体** 文本*
@@ -0,0 +1,26 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 28
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 28
},
"children": [
{
"kind": "text",
"span": {
"start": 0,
"end": 28
},
"literal": "snake_case_name 不是强调"
}
]
}
]
}
@@ -0,0 +1 @@
snake_case_name 不是强调
@@ -0,0 +1,50 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 15
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 15
},
"children": [
{
"kind": "emph",
"span": {
"start": 0,
"end": 15
},
"children": [
{
"kind": "text",
"span": {
"start": 1,
"end": 7
},
"literal": "多行"
},
{
"kind": "soft_break",
"span": {
"start": 7,
"end": 8
}
},
{
"kind": "text",
"span": {
"start": 8,
"end": 14
},
"literal": "斜体"
}
]
}
]
}
]
}
@@ -0,0 +1,2 @@
*多行
斜体*
@@ -0,0 +1,76 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 36
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 36
},
"children": [
{
"kind": "text",
"span": {
"start": 0,
"end": 6
},
"literal": "这是"
},
{
"kind": "strong",
"span": {
"start": 6,
"end": 16
},
"children": [
{
"kind": "text",
"span": {
"start": 8,
"end": 14
},
"literal": "加粗"
}
]
},
{
"kind": "text",
"span": {
"start": 16,
"end": 25
},
"literal": ",这是"
},
{
"kind": "emph",
"span": {
"start": 25,
"end": 33
},
"children": [
{
"kind": "text",
"span": {
"start": 26,
"end": 32
},
"literal": "斜体"
}
]
},
{
"kind": "text",
"span": {
"start": 33,
"end": 36
},
"literal": "。"
}
]
}
]
}
@@ -0,0 +1 @@
这是**加粗**,这是*斜体*。
@@ -0,0 +1,36 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 11
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 11
},
"children": [
{
"kind": "strong",
"span": {
"start": 0,
"end": 11
},
"children": [
{
"kind": "code",
"ticks": 1,
"span": {
"start": 2,
"end": 9
},
"literal": "x = 1"
}
]
}
]
}
]
}
@@ -0,0 +1 @@
**`x = 1`**
@@ -0,0 +1,36 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 9
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 9
},
"children": [
{
"kind": "emph",
"span": {
"start": 0,
"end": 9
},
"children": [
{
"kind": "code",
"ticks": 1,
"span": {
"start": 1,
"end": 8
},
"literal": "n - 1"
}
]
}
]
}
]
}
@@ -0,0 +1 @@
*`n - 1`*
@@ -0,0 +1,27 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 7
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 7
},
"children": [
{
"kind": "code",
"ticks": 1,
"span": {
"start": 0,
"end": 7
},
"literal": "x = 1"
}
]
}
]
}
@@ -0,0 +1 @@
`x = 1`
@@ -0,0 +1,27 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 7
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 7
},
"children": [
{
"kind": "code",
"ticks": 2,
"span": {
"start": 0,
"end": 7
},
"literal": "a`b"
}
]
}
]
}
@@ -0,0 +1 @@
``a`b``
@@ -0,0 +1,27 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 10
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 10
},
"children": [
{
"kind": "code",
"ticks": 3,
"span": {
"start": 0,
"end": 10
},
"literal": "a``b"
}
]
}
]
}
@@ -0,0 +1 @@
```a``b```
@@ -0,0 +1,27 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 16
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 16
},
"children": [
{
"kind": "code",
"ticks": 1,
"span": {
"start": 0,
"end": 16
},
"literal": "保留空格"
}
]
}
]
}
@@ -0,0 +1 @@
` 保留空格 `
@@ -0,0 +1,26 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 2
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 2
},
"children": [
{
"kind": "text",
"span": {
"start": 0,
"end": 2
},
"literal": "``"
}
]
}
]
}
@@ -0,0 +1 @@
``
@@ -0,0 +1,27 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 16
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 16
},
"children": [
{
"kind": "code",
"ticks": 1,
"span": {
"start": 0,
"end": 16
},
"literal": "a * b / c ** d"
}
]
}
]
}
@@ -0,0 +1 @@
`a * b / c ** d`
@@ -0,0 +1,27 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 21
},
"children": [
{
"kind": "paragraph",
"span": {
"start": 0,
"end": 21
},
"children": [
{
"kind": "code",
"ticks": 1,
"span": {
"start": 0,
"end": 21
},
"literal": "第一行 第二行"
}
]
}
]
}
@@ -0,0 +1,2 @@
`第一行
第二行`
@@ -0,0 +1,19 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 13
},
"children": [
{
"kind": "code_block",
"fenced": true,
"info": "",
"span": {
"start": 0,
"end": 13
},
"literal": "x = 1\n"
}
]
}
@@ -0,0 +1,3 @@
```
x = 1
```
@@ -0,0 +1,19 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 24
},
"children": [
{
"kind": "code_block",
"fenced": true,
"info": "rust",
"span": {
"start": 0,
"end": 24
},
"literal": "fn main() {}\n"
}
]
}
@@ -0,0 +1,3 @@
```rust
fn main() {}
```
@@ -0,0 +1,19 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 29
},
"children": [
{
"kind": "code_block",
"fenced": true,
"info": "rust ignore",
"span": {
"start": 0,
"end": 29
},
"literal": "let x = 1;\n"
}
]
}
@@ -0,0 +1,3 @@
```rust ignore
let x = 1;
```
@@ -0,0 +1,19 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 22
},
"children": [
{
"kind": "code_block",
"fenced": true,
"info": "python",
"span": {
"start": 0,
"end": 22
},
"literal": "print(1)\n"
}
]
}
@@ -0,0 +1,3 @@
~~~python
print(1)
~~~
@@ -0,0 +1,19 @@
{
"kind": "document",
"span": {
"start": 0,
"end": 33
},
"children": [
{
"kind": "code_block",
"fenced": false,
"info": "",
"span": {
"start": 4,
"end": 33
},
"literal": "indented code\nsecond line\n"
}
]
}
Loaded 100 of 511 files, more files were not shown because too many files have changed in this diff. Show more