Handle greater blocks with only blank space inside them.

This commit is contained in:
Tom Alexander
2023-04-18 21:28:22 -04:00
parent 0effc7c087
commit 13a2ba1dc5
2 changed files with 34 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
use super::object::Object;
use super::object::{Object, TextMarkup};
#[derive(Debug)]
pub struct Paragraph<'s> {
@@ -10,3 +10,14 @@ pub struct Paragraph<'s> {
pub struct Comment<'s> {
pub source: &'s str,
}
impl<'s> Paragraph<'s> {
pub fn of_text(input: &'s str) -> Self {
let mut objects = Vec::with_capacity(1);
objects.push(Object::TextMarkup(TextMarkup { source: input }));
Paragraph {
source: input,
children: objects,
}
}
}