18 lines
400 B
Rust
18 lines
400 B
Rust
|
use crate::blog_post::util::coalesce_whitespace;
|
||
|
use crate::error::CustomError;
|
||
|
|
||
|
#[derive(Debug)]
|
||
|
pub(crate) struct PlainText {
|
||
|
source: String,
|
||
|
}
|
||
|
|
||
|
impl PlainText {
|
||
|
pub(crate) fn new(
|
||
|
plain_text: &organic::types::PlainText<'_>,
|
||
|
) -> Result<PlainText, CustomError> {
|
||
|
Ok(PlainText {
|
||
|
source: coalesce_whitespace(plain_text.source).into_owned(),
|
||
|
})
|
||
|
}
|
||
|
}
|