Populate the name field on elements.
This commit is contained in:
@@ -148,12 +148,15 @@ pub enum SwitchNumberLines {
|
||||
}
|
||||
|
||||
impl<'s> Paragraph<'s> {
|
||||
/// Generate a paragraph of the passed in text with no additional properties.
|
||||
///
|
||||
/// This is used for elements that support an "empty" content like greater blocks.
|
||||
pub(crate) fn of_text(input: &'s str) -> Self {
|
||||
let mut objects = Vec::with_capacity(1);
|
||||
objects.push(Object::PlainText(PlainText { source: input }));
|
||||
Paragraph {
|
||||
source: input,
|
||||
name: None, // TODO
|
||||
name: None,
|
||||
children: objects,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user