diff --git a/crates/rdocx/src/paragraph.rs b/crates/rdocx/src/paragraph.rs index 74d45af..c336526 100644 --- a/crates/rdocx/src/paragraph.rs +++ b/crates/rdocx/src/paragraph.rs @@ -415,6 +415,15 @@ impl<'a> ParagraphRef<'a> { .map(Alignment::from_st_jc) } + /// Check if this paragraph has a page break before it. + pub fn is_page_break_before(&self) -> bool { + self.inner + .properties + .as_ref() + .and_then(|ppr| ppr.page_break_before) + .unwrap_or(false) + } + /// Get an iterator over immutable run references. pub fn runs(&self) -> impl Iterator> { self.inner.runs.iter().map(|r| RunRef { inner: r }) diff --git a/crates/rdocx/src/run.rs b/crates/rdocx/src/run.rs index acb446e..785f81c 100644 --- a/crates/rdocx/src/run.rs +++ b/crates/rdocx/src/run.rs @@ -236,6 +236,15 @@ impl<'a> RunRef<'a> { .unwrap_or(false) } + /// Check if underline. + pub fn is_underline(&self) -> bool { + self.inner + .properties + .as_ref() + .and_then(|rpr| rpr.underline.as_ref()) + .is_some() + } + /// Get font size in points, if set. pub fn size(&self) -> Option { self.inner