use super::macros::intermediate; use crate::error::CustomError; #[derive(Debug, Clone)] pub(crate) struct ISrcBlock { pub(crate) lines: Vec, pub(crate) language: Option, } intermediate!( ISrcBlock, &'orig organic::types::SrcBlock<'parse>, original, _registry, { let lines = original .get_value() .split_inclusive('\n') .map(|s| s.to_owned()) .collect(); let language = original.language.map(str::to_owned); Ok(ISrcBlock { lines, language }) } );