Add tests for broken export blocks.

This commit is contained in:
Tom Alexander 2023-04-21 18:11:26 -04:00
parent fa4766b64e
commit cdcaae11c4
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 7 additions and 1 deletions

View File

@ -0,0 +1,3 @@
#+begin_export
This would be LaTeX code.
#+end_export

View File

@ -0,0 +1,3 @@
#+begin_export latex html
This would be LaTeX code.
#+end_export

View File

@ -173,7 +173,7 @@ pub fn export_block<'r, 's>(
input: &'s str, input: &'s str,
) -> Res<&'s str, ExportBlock<'s>> { ) -> Res<&'s str, ExportBlock<'s>> {
let (remaining, name) = lesser_block_begin("export")(context, input)?; let (remaining, name) = lesser_block_begin("export")(context, input)?;
// TODO: Data is mandatory and must be a single word // https://orgmode.org/worg/org-syntax.html#Blocks claims that export blocks must have a single word for data but testing shows no data and multi-word data still parses as an export block.
let (remaining, parameters) = opt(tuple((space1, data)))(remaining)?; let (remaining, parameters) = opt(tuple((space1, data)))(remaining)?;
let (remaining, _nl) = line_ending(remaining)?; let (remaining, _nl) = line_ending(remaining)?;
let lesser_block_end_specialized = lesser_block_end("export"); let lesser_block_end_specialized = lesser_block_end("export");