diff --git a/docx-core/src/documents/elements/run.rs b/docx-core/src/documents/elements/run.rs index c800f7c..786ceea 100644 --- a/docx-core/src/documents/elements/run.rs +++ b/docx-core/src/documents/elements/run.rs @@ -268,6 +268,11 @@ impl Run { self } + pub fn strike(mut self) -> Run { + self.run_property = self.run_property.strike(); + self + } + pub fn text_border(mut self, b: TextBorder) -> Run { self.run_property = self.run_property.text_border(b); self @@ -366,6 +371,15 @@ mod tests { ); } + #[test] + fn test_strike() { + let b = Run::new().add_text("Hello").strike().build(); + assert_eq!( + str::from_utf8(&b).unwrap(), + r#"Hello"# + ); + } + #[test] fn test_child_json() { let c = RunChild::Text(Text::new("Hello"));