21 lines
526 B
Rust
21 lines
526 B
Rust
use crate::error::CustomError;
|
|
use crate::intermediate::util::coalesce_whitespace;
|
|
|
|
use super::registry::Registry;
|
|
|
|
#[derive(Debug, Clone)]
|
|
pub(crate) struct IPlainText {
|
|
pub(crate) source: String,
|
|
}
|
|
|
|
impl IPlainText {
|
|
pub(crate) async fn new<'b, 'parse>(
|
|
registry: &'b mut Registry<'parse>,
|
|
plain_text: &'b organic::types::PlainText<'parse>,
|
|
) -> Result<IPlainText, CustomError> {
|
|
Ok(IPlainText {
|
|
source: coalesce_whitespace(plain_text.source).into_owned(),
|
|
})
|
|
}
|
|
}
|