Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions crates/rdocx/src/paragraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item = RunRef<'_>> {
self.inner.runs.iter().map(|r| RunRef { inner: r })
Expand Down
9 changes: 9 additions & 0 deletions crates/rdocx/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<f64> {
self.inner
Expand Down