Introduce a registry into the conversion to intermediate format.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use crate::error::CustomError;
|
||||
|
||||
use super::plain_text::IPlainText;
|
||||
use super::registry::Registry;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) enum IObject {
|
||||
@@ -8,7 +9,10 @@ pub(crate) enum IObject {
|
||||
}
|
||||
|
||||
impl IObject {
|
||||
pub(crate) fn new(obj: &organic::types::Object<'_>) -> Result<IObject, CustomError> {
|
||||
pub(crate) fn new(
|
||||
registry: &mut Registry<'_>,
|
||||
obj: &organic::types::Object<'_>,
|
||||
) -> Result<IObject, CustomError> {
|
||||
match obj {
|
||||
organic::types::Object::Bold(_) => todo!(),
|
||||
organic::types::Object::Italic(_) => todo!(),
|
||||
@@ -17,7 +21,7 @@ impl IObject {
|
||||
organic::types::Object::Code(_) => todo!(),
|
||||
organic::types::Object::Verbatim(_) => todo!(),
|
||||
organic::types::Object::PlainText(plain_text) => {
|
||||
Ok(IObject::PlainText(IPlainText::new(plain_text)?))
|
||||
Ok(IObject::PlainText(IPlainText::new(registry, plain_text)?))
|
||||
}
|
||||
organic::types::Object::RegularLink(_) => todo!(),
|
||||
organic::types::Object::RadioLink(_) => todo!(),
|
||||
|
||||
Reference in New Issue
Block a user