Fix footnote reference type.

This commit is contained in:
Tom Alexander 2023-10-09 13:23:08 -04:00
parent 9565435526
commit 5ac12229f4
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 22 additions and 1 deletions

View File

@ -54,6 +54,7 @@ use crate::types::ExportSnippet;
use crate::types::FixedWidthArea; use crate::types::FixedWidthArea;
use crate::types::FootnoteDefinition; use crate::types::FootnoteDefinition;
use crate::types::FootnoteReference; use crate::types::FootnoteReference;
use crate::types::FootnoteReferenceType;
use crate::types::GetStandardProperties; use crate::types::GetStandardProperties;
use crate::types::Heading; use crate::types::Heading;
use crate::types::HorizontalRule; use crate::types::HorizontalRule;
@ -3323,7 +3324,10 @@ fn compare_footnote_reference<'b, 's>(
), ),
( (
EmacsField::Required(":type"), EmacsField::Required(":type"),
|_| Some("inline"), |r| Some(match r.get_type() {
FootnoteReferenceType::Standard => "standard",
FootnoteReferenceType::Inline => "inline",
}),
compare_property_unquoted_atom compare_property_unquoted_atom
) )
)? { )? {

View File

@ -69,6 +69,7 @@ pub use object::DayOfMonthInner;
pub use object::Entity; pub use object::Entity;
pub use object::ExportSnippet; pub use object::ExportSnippet;
pub use object::FootnoteReference; pub use object::FootnoteReference;
pub use object::FootnoteReferenceType;
pub use object::Hour; pub use object::Hour;
pub use object::HourInner; pub use object::HourInner;
pub use object::InlineBabelCall; pub use object::InlineBabelCall;

View File

@ -764,3 +764,19 @@ impl<'s> OrgMacro<'s> {
.map(|arg| coalesce_whitespace_escaped('\\', |c| ",".contains(c))(*arg)) .map(|arg| coalesce_whitespace_escaped('\\', |c| ",".contains(c))(*arg))
} }
} }
#[derive(Debug, PartialEq)]
pub enum FootnoteReferenceType {
Standard,
Inline,
}
impl<'s> FootnoteReference<'s> {
pub fn get_type(&self) -> FootnoteReferenceType {
if self.definition.is_empty() {
FootnoteReferenceType::Standard
} else {
FootnoteReferenceType::Inline
}
}
}