2023-10-27 14:23:05 +00:00
|
|
|
use crate::error::CustomError;
|
2023-10-27 17:05:34 +00:00
|
|
|
use crate::intermediate::util::coalesce_whitespace;
|
2023-10-27 14:23:05 +00:00
|
|
|
|
2023-10-27 18:43:06 +00:00
|
|
|
use super::registry::Registry;
|
|
|
|
|
2023-10-27 14:23:05 +00:00
|
|
|
#[derive(Debug)]
|
2023-10-27 17:05:34 +00:00
|
|
|
pub(crate) struct IPlainText {
|
2023-10-27 14:23:05 +00:00
|
|
|
source: String,
|
|
|
|
}
|
|
|
|
|
2023-10-27 17:05:34 +00:00
|
|
|
impl IPlainText {
|
2023-10-27 14:23:05 +00:00
|
|
|
pub(crate) fn new(
|
2023-10-27 18:43:06 +00:00
|
|
|
registry: &mut Registry<'_>,
|
2023-10-27 14:23:05 +00:00
|
|
|
plain_text: &organic::types::PlainText<'_>,
|
2023-10-27 17:05:34 +00:00
|
|
|
) -> Result<IPlainText, CustomError> {
|
|
|
|
Ok(IPlainText {
|
2023-10-27 14:23:05 +00:00
|
|
|
source: coalesce_whitespace(plain_text.source).into_owned(),
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|