We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e49cd3d commit 378bc91Copy full SHA for 378bc91
src/cargo/util/frontmatter.rs
@@ -120,8 +120,15 @@ impl<'s> ScriptSource<'s> {
120
121
source.content = content_start..content_end;
122
123
- let repeat = Self::parse(source.content())?;
124
- if repeat.frontmatter.is_some() {
+ if let Some(nl_end) = strip_ws_lines(input.as_ref()) {
+ let _ = input.next_slice(nl_end);
125
+ }
126
+ let fence_length = input
127
+ .as_ref()
128
+ .char_indices()
129
+ .find_map(|(i, c)| (c != FENCE_CHAR).then_some(i))
130
+ .unwrap_or_else(|| input.eof_offset());
131
+ if 0 < fence_length {
132
return Err(FrontmatterError::new(format!(
133
"only one frontmatter is supported"
134
)));
0 commit comments