diff --git a/org_mode_samples/lesser_block/src_with_no_data.org b/org_mode_samples/lesser_block/src_with_no_data.org new file mode 100644 index 00000000..a6d55b07 --- /dev/null +++ b/org_mode_samples/lesser_block/src_with_no_data.org @@ -0,0 +1,3 @@ +#+begin_src + echo "this is a source block." +#+end_src diff --git a/src/parser/lesser_block.rs b/src/parser/lesser_block.rs index a7db16a8..7db64209 100644 --- a/src/parser/lesser_block.rs +++ b/src/parser/lesser_block.rs @@ -212,7 +212,7 @@ pub fn export_block<'r, 's>( #[tracing::instrument(ret, level = "debug")] pub fn src_block<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, SrcBlock<'s>> { let (remaining, name) = lesser_block_begin("src")(context, input)?; - // TODO: DATA is mandatory and must follow the LANGUAGE SWITCHES ARGUMENTS pattern + // https://orgmode.org/worg/org-syntax.html#Blocks claims that data is mandatory and must follow the LANGUAGE SWITCHES ARGUMENTS pattern but testing has shown that no data and incorrect data here will still parse to a src block. let (remaining, parameters) = opt(tuple((space1, data)))(remaining)?; let (remaining, _nl) = line_ending(remaining)?; let lesser_block_end_specialized = lesser_block_end("src");