Fix retain labels.

This is a numeric value based on the character offset of -k from the beginning of the switches.
This commit is contained in:
Tom Alexander
2023-10-04 15:20:57 -04:00
parent 32da06776c
commit 301a6db83e
5 changed files with 39 additions and 17 deletions

View File

@@ -18,6 +18,7 @@ use crate::types::AstNode;
use crate::types::BabelCall;
use crate::types::Bold;
use crate::types::CenterBlock;
use crate::types::CharOffsetInLine;
use crate::types::CheckboxType;
use crate::types::Citation;
use crate::types::CitationReference;
@@ -1543,7 +1544,7 @@ fn compare_example_block<'b, 's>(
_source: &'s str,
emacs: &'b Token<'s>,
rust: &'b ExampleBlock<'s>,
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error>> {
) -> Result<DiffEntry<'b, 's>, Box<dyn std::error::Error + 's>> {
let mut this_status = DiffStatus::Good;
let mut message = None;
@@ -1624,7 +1625,7 @@ fn compare_example_block<'b, 's>(
}
// Compare retain-labels
let retain_labels = get_property_boolean(emacs, ":retain-labels")?;
let retain_labels: Option<CharOffsetInLine> = get_property_numeric(emacs, ":retain-labels")?;
if retain_labels != rust.retain_labels {
this_status = DiffStatus::Bad;
message = Some(format!(