Support strike at Run level: add strike() to Run (#732)
parent
87de45e198
commit
0284e7aa4c
|
@ -268,6 +268,11 @@ impl Run {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn strike(mut self) -> Run {
|
||||||
|
self.run_property = self.run_property.strike();
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
pub fn text_border(mut self, b: TextBorder) -> Run {
|
pub fn text_border(mut self, b: TextBorder) -> Run {
|
||||||
self.run_property = self.run_property.text_border(b);
|
self.run_property = self.run_property.text_border(b);
|
||||||
self
|
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#"<w:r><w:rPr><w:strike /></w:rPr><w:t xml:space="preserve">Hello</w:t></w:r>"#
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_child_json() {
|
fn test_child_json() {
|
||||||
let c = RunChild::Text(Text::new("Hello"));
|
let c = RunChild::Text(Text::new("Hello"));
|
||||||
|
|
Loading…
Reference in New Issue