Skip to content

Commit

Permalink
fix: use <boomark /> for Mark on ACSS
Browse files Browse the repository at this point in the history
  • Loading branch information
decahedron1 committed Dec 16, 2024
1 parent 440d0d5 commit 8dde3c5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/mark.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use alloc::{borrow::Cow, string::ToString};
use core::fmt::Write;

use crate::{Serialize, SerializeOptions, XmlWriter};
use crate::{Flavor, Serialize, SerializeOptions, XmlWriter};

#[derive(Debug, Clone)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
Expand Down Expand Up @@ -37,8 +37,12 @@ impl<'s> Mark<'s> {
}

impl<'s> Serialize for Mark<'s> {
fn serialize_xml<W: Write>(&self, writer: &mut XmlWriter<W>, _: &SerializeOptions) -> crate::Result<()> {
writer.element("mark", |writer| writer.attr("name", &*self.name))
fn serialize_xml<W: Write>(&self, writer: &mut XmlWriter<W>, options: &SerializeOptions) -> crate::Result<()> {
if options.flavor == Flavor::MicrosoftAzureCognitiveSpeechServices {
writer.element("bookmark", |writer| writer.attr("mark", &*self.name))
} else {
writer.element("mark", |writer| writer.attr("name", &*self.name))
}
}
}

Expand Down

0 comments on commit 8dde3c5

Please sign in to comment.