Skip to content

Commit 8bcb9ed

Browse files
authored
Updates/2025 10 27 (#79)
* fix metadata tracking bug * attribute source tracking * move to insta for snapshots * fix table caption parsing * fix many typescript annotatedparse issues
1 parent 54a3968 commit 8bcb9ed

File tree

125 files changed

+6764
-339
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+6764
-339
lines changed

crates/quarto-markdown-pandoc/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@ hashlink = { version = "0.10.0", features = ["serde_impl"] }
3131
error-message-macros = { path = "./error-message-macros" }
3232
ariadne = "0.4"
3333

34+
[dev-dependencies]
35+
insta = { version = "1.40", features = ["json", "redactions"] }
36+
3437
[lints]
3538
workspace = true
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
source: crates/quarto-markdown-pandoc/tests/test_error_corpus.rs
3+
expression: json_string
4+
---
5+
[
6+
{
7+
"details": [
8+
{
9+
"content": {
10+
"content": "This is the opening bracket for the span",
11+
"type": "markdown"
12+
},
13+
"kind": "info",
14+
"location": {
15+
"Original": {
16+
"end_offset": 4,
17+
"file_id": 0,
18+
"start_offset": 3
19+
}
20+
}
21+
}
22+
],
23+
"kind": "error",
24+
"location": {
25+
"Original": {
26+
"end_offset": 18,
27+
"file_id": 0,
28+
"start_offset": 17
29+
}
30+
},
31+
"problem": {
32+
"content": "I reached the end of the block before finding a closing ']' for the span or link.",
33+
"type": "markdown"
34+
},
35+
"title": "Unclosed Span"
36+
}
37+
]
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
source: crates/quarto-markdown-pandoc/tests/test_error_corpus.rs
3+
expression: json_string
4+
---
5+
[
6+
{
7+
"details": [
8+
{
9+
"content": {
10+
"content": "The attribute specifier starts here.",
11+
"type": "markdown"
12+
},
13+
"kind": "info",
14+
"location": {
15+
"Original": {
16+
"end_offset": 18,
17+
"file_id": 0,
18+
"start_offset": 17
19+
}
20+
}
21+
}
22+
],
23+
"kind": "error",
24+
"location": {
25+
"Original": {
26+
"end_offset": 19,
27+
"file_id": 0,
28+
"start_offset": 18
29+
}
30+
},
31+
"problem": {
32+
"content": "I expected a '}', language specifier, an identifier, a class specifier, or a key-value pair.",
33+
"type": "markdown"
34+
},
35+
"title": "Mismatched Delimiter in Attribute Specifier"
36+
}
37+
]
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
source: crates/quarto-markdown-pandoc/tests/test_error_corpus.rs
3+
expression: json_string
4+
---
5+
[
6+
{
7+
"details": [
8+
{
9+
"content": {
10+
"content": "This key-value pair cannot appear before the class specifier.",
11+
"type": "markdown"
12+
},
13+
"kind": "info",
14+
"location": {
15+
"Original": {
16+
"end_offset": 19,
17+
"file_id": 0,
18+
"start_offset": 10
19+
}
20+
}
21+
}
22+
],
23+
"kind": "error",
24+
"location": {
25+
"Original": {
26+
"end_offset": 26,
27+
"file_id": 0,
28+
"start_offset": 20
29+
}
30+
},
31+
"problem": {
32+
"content": "This class specifier appears after the key-value pair.",
33+
"type": "markdown"
34+
},
35+
"title": "Key-value Pair Before Class Specifier in Attribute"
36+
}
37+
]
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
source: crates/quarto-markdown-pandoc/tests/test_error_corpus.rs
3+
expression: json_string
4+
---
5+
[
6+
{
7+
"details": [
8+
{
9+
"content": {
10+
"content": "This div fence needs a space before the attribute.",
11+
"type": "markdown"
12+
},
13+
"kind": "info",
14+
"location": {
15+
"Original": {
16+
"end_offset": 3,
17+
"file_id": 0,
18+
"start_offset": 0
19+
}
20+
}
21+
},
22+
{
23+
"content": {
24+
"content": "Add a space here before the attribute.",
25+
"type": "markdown"
26+
},
27+
"kind": "info",
28+
"location": {
29+
"Original": {
30+
"end_offset": 4,
31+
"file_id": 0,
32+
"start_offset": 3
33+
}
34+
}
35+
}
36+
],
37+
"kind": "error",
38+
"location": {
39+
"Original": {
40+
"end_offset": 4,
41+
"file_id": 0,
42+
"start_offset": 3
43+
}
44+
},
45+
"problem": {
46+
"content": "A space is required after ':::' when specifying div attributes.",
47+
"type": "markdown"
48+
},
49+
"title": "Missing Space After Div Fence"
50+
},
51+
{
52+
"kind": "error",
53+
"location": {
54+
"Original": {
55+
"end_offset": 43,
56+
"file_id": 0,
57+
"start_offset": 42
58+
}
59+
},
60+
"problem": {
61+
"content": "unexpected character or token here",
62+
"type": "markdown"
63+
},
64+
"title": "Parse error"
65+
}
66+
]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
source: crates/quarto-markdown-pandoc/tests/test_error_corpus.rs
3+
expression: error_output
4+
---
5+
Error: Unclosed Span
6+
╭─[resources/error-corpus/001.qmd:1:18]
7+
│
8+
1 │ an [unclosed span
9+
 │ ┬ ┬
10+
 │ ╰──────────────── This is the opening bracket for the span
11+
 │ │
12+
 │ ╰── I reached the end of the block before finding a closing ']' for the span or link.
13+
───╯
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
source: crates/quarto-markdown-pandoc/tests/test_error_corpus.rs
3+
expression: error_output
4+
---
5+
Error: Mismatched Delimiter in Attribute Specifier
6+
╭─[resources/error-corpus/002.qmd:1:19]
7+
│
8+
1 │ A bad [attribute]{[
9+
 │ ┬┬
10+
 │ ╰─── The attribute specifier starts here.
11+
 │ │
12+
 │ ╰── I expected a '}', language specifier, an identifier, a class specifier, or a key-value pair.
13+
───╯
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
source: crates/quarto-markdown-pandoc/tests/test_error_corpus.rs
3+
expression: error_output
4+
---
5+
Error: Key-value Pair Before Class Specifier in Attribute
6+
╭─[resources/error-corpus/003.qmd:1:21]
7+
│
8+
1 │ [foo]{#id key=value .class}
9+
 │ ────┬──── ───┬──
10+
 │ ╰───────────── This key-value pair cannot appear before the class specifier.
11+
 │ │
12+
 │ ╰──── This class specifier appears after the key-value pair.
13+
───╯
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
source: crates/quarto-markdown-pandoc/tests/test_error_corpus.rs
3+
expression: error_output
4+
---
5+
Error: Missing Space After Div Fence
6+
╭─[resources/error-corpus/004.qmd:1:4]
7+
│
8+
1 │ :::{.callout-note}
9+
 │ ─┬─┬
10+
 │ ╰──── This div fence needs a space before the attribute.
11+
 │ │
12+
 │ ╰── A space is required after ':::' when specifying div attributes.
13+
 │ │
14+
 │ ╰── Add a space here before the attribute.
15+
───╯
16+
17+
Error: Parse error
18+
unexpected character or token here
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
source: crates/quarto-markdown-pandoc/tests/test.rs
3+
expression: output
4+
---
5+
{"astContext":{"files":[{"line_breaks":[24],"name":"tests/snapshots/json/001.qmd","total_length":25}],"sourceInfoPool":[{"d":0,"r":[0,4],"t":0},{"d":0,"r":[4,5],"t":0},{"d":0,"r":[5,7],"t":0},{"d":0,"r":[7,8],"t":0},{"d":0,"r":[8,9],"t":0},{"d":0,"r":[9,10],"t":0},{"d":0,"r":[12,16],"t":0},{"d":0,"r":[10,18],"t":0},{"d":0,"r":[18,19],"t":0},{"d":0,"r":[19,23],"t":0},{"d":0,"r":[23,24],"t":0},{"d":[[9,0,4],[10,4,1]],"r":[0,5],"t":2},{"d":0,"r":[0,25],"t":0}]},"blocks":[{"c":[{"c":"This","s":0,"t":"Str"},{"s":1,"t":"Space"},{"c":"is","s":2,"t":"Str"},{"s":3,"t":"Space"},{"c":"a","s":4,"t":"Str"},{"s":5,"t":"Space"},{"c":[{"c":"bold","s":6,"t":"Str"}],"s":7,"t":"Strong"},{"s":8,"t":"Space"},{"c":"test.","s":11,"t":"Str"}],"s":12,"t":"Para"}],"meta":{},"pandoc-api-version":[1,23,1]}

0 commit comments

Comments
 (0)