Parse decimal IDML ACE codes in craft-idml

This commit is contained in:
Dylan M. Taylor committed 2026-11-13 09:05:19 -05:00
1 parent 0e9a95b2ce
commit c0b474cd2d
1 file changed
+5
+5
View File
@@ -259,6 +259,11 @@ pub enum Ace {
}
impl Ace {
/// Parses an IDML ACE instruction's decimal code.
pub fn from_decimal(value: &str) -> Option<Ace> {
value.trim().parse::<u32>().ok().map(Ace::from_code)
}
pub fn from_code(code: u32) -> Ace {
match code {
4 => Ace::FootnoteNumber,