Add paragraph.

This commit is contained in:
Tom Alexander
2023-10-27 15:46:16 -04:00
parent 5b34942b64
commit 4a6948cde7
7 changed files with 83 additions and 8 deletions

View File

@@ -1,9 +1,12 @@
use crate::error::CustomError;
use super::registry::Registry;
use super::IParagraph;
#[derive(Debug)]
pub(crate) enum IElement {}
pub(crate) enum IElement {
Paragraph(IParagraph),
}
impl IElement {
pub(crate) fn new<'parse>(
@@ -11,7 +14,9 @@ impl IElement {
elem: &organic::types::Element<'parse>,
) -> Result<IElement, CustomError> {
match elem {
organic::types::Element::Paragraph(_) => todo!(),
organic::types::Element::Paragraph(inner) => {
Ok(IElement::Paragraph(IParagraph::new(registry, inner)?))
}
organic::types::Element::PlainList(_) => todo!(),
organic::types::Element::CenterBlock(_) => todo!(),
organic::types::Element::QuoteBlock(_) => todo!(),