diff --git a/org_mode_samples/lesser_element/lesser_block/comment/escaped_lines.org b/org_mode_samples/lesser_element/lesser_block/comment/escaped_lines.org new file mode 100644 index 0000000..f45bc0d --- /dev/null +++ b/org_mode_samples/lesser_element/lesser_block/comment/escaped_lines.org @@ -0,0 +1,10 @@ +#+begin_comment +,* foo +,,,** bar + ,*** baz + lorem + , ipsum +,#+begin_src dolar + +,#+end_src +#+end_comment diff --git a/org_mode_samples/lesser_element/lesser_block/export/escaped_lines.org b/org_mode_samples/lesser_element/lesser_block/export/escaped_lines.org new file mode 100644 index 0000000..fe8f05b --- /dev/null +++ b/org_mode_samples/lesser_element/lesser_block/export/escaped_lines.org @@ -0,0 +1,10 @@ +#+begin_export html +,* foo +,,,** bar + ,*** baz + lorem + , ipsum +,#+begin_src dolar + +,#+end_src +#+end_export diff --git a/org_mode_samples/lesser_element/lesser_block/export/with_no_data.org b/org_mode_samples/lesser_element/lesser_block/export/no_data.org similarity index 100% rename from org_mode_samples/lesser_element/lesser_block/export/with_no_data.org rename to org_mode_samples/lesser_element/lesser_block/export/no_data.org diff --git a/org_mode_samples/lesser_element/lesser_block/export/one_word.org b/org_mode_samples/lesser_element/lesser_block/export/one_word.org new file mode 100644 index 0000000..77bf40f --- /dev/null +++ b/org_mode_samples/lesser_element/lesser_block/export/one_word.org @@ -0,0 +1,3 @@ +#+begin_export latex +This would be LaTeX code. +#+end_export diff --git a/org_mode_samples/lesser_element/lesser_block/export/with_two_words.org b/org_mode_samples/lesser_element/lesser_block/export/two_words.org similarity index 100% rename from org_mode_samples/lesser_element/lesser_block/export/with_two_words.org rename to org_mode_samples/lesser_element/lesser_block/export/two_words.org diff --git a/src/compare/diff.rs b/src/compare/diff.rs index 22e9eb4..9c82f01 100644 --- a/src/compare/diff.rs +++ b/src/compare/diff.rs @@ -1845,9 +1845,19 @@ fn compare_export_block<'b, 's>( let mut this_status = DiffStatus::Good; let mut message = None; - // TODO: Compare :type :value - + // TODO: Compare :type // TODO: Compare :caption + + // Compare value + let contents = get_property_quoted_string(emacs, ":value")?.unwrap_or(String::new()); + if contents != rust.contents { + this_status = DiffStatus::Bad; + message = Some(format!( + "Value mismatch (emacs != rust) {:?} != {:?}", + contents, rust.contents + )); + } + // Compare name let name = get_property_quoted_string(emacs, ":name")?; if name.as_ref().map(String::as_str) != rust.name { diff --git a/src/parser/lesser_block.rs b/src/parser/lesser_block.rs index f4cf792..994f4f7 100644 --- a/src/parser/lesser_block.rs +++ b/src/parser/lesser_block.rs @@ -227,7 +227,7 @@ pub(crate) fn export_block<'b, 'g, 'r, 's>( None => None, }; - let (remaining, contents) = parser_with_context!(text_until_exit)(&parser_context)(remaining)?; + let (remaining, contents) = content(&parser_context, remaining)?; let (remaining, _end) = lesser_block_end_specialized(&parser_context, remaining)?; let source = get_consumed(input, remaining); @@ -237,7 +237,7 @@ pub(crate) fn export_block<'b, 'g, 'r, 's>( source: source.into(), name: get_name(&affiliated_keywords), data: parameters.map(|parameters| Into::<&str>::into(parameters)), - contents: contents.into(), + contents, }, )) } diff --git a/src/types/lesser_element.rs b/src/types/lesser_element.rs index 91091fc..b62f61c 100644 --- a/src/types/lesser_element.rs +++ b/src/types/lesser_element.rs @@ -65,7 +65,7 @@ pub struct ExportBlock<'s> { pub source: &'s str, pub name: Option<&'s str>, pub data: Option<&'s str>, - pub contents: &'s str, + pub contents: String, } #[derive(Debug)]