Skip to content

Commit ac4abda

Browse files
authored
so that is necessary (#19)
1 parent 64ae1e1 commit ac4abda

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/metadata/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ pub mod stage_1;
77

88
/// Parses the given input string to produce an AST for the metadata
99
pub fn parse_metadata(input: &str) -> Result<NorgMeta, NorgParseError> {
10-
let processed = format!("{{\n{}\n}}\n", input.trim());
10+
// don't ask me why this fixes it. I don't even care
11+
let processed = input.replace("\n]", "\n ]");
12+
let processed = format!("{{\n{}\n}}\n", processed.trim());
1113
Ok(stage_1::meta_parser().parse(processed)?)
1214
}
1315

@@ -91,7 +93,7 @@ mod tests {
9193
hi
9294
]
9395
]",
94-
"arr:[]\na2:[\n]x: y",
96+
"arr:[]\na2:[\n]\na3:[\nhi\n]\nx: y",
9597
]
9698
.into_iter()
9799
.map(|example| example.to_string() + "\n")

src/metadata/snapshots/rust_norg__metadata__tests__arrays.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ expression: examples
3434
- Object:
3535
a2:
3636
Array: []
37+
a3:
38+
Array:
39+
- Str: hi
3740
arr:
3841
Array: []
3942
x:

0 commit comments

Comments
 (0)