Remove the SetSource trait.

It was only being used for creating paragraphs of specific text, so I just adjusted the of_text function to handle it.
This commit is contained in:
Tom Alexander
2023-10-23 17:22:52 -04:00
parent f47d688be4
commit 5e2dea1f28
8 changed files with 14 additions and 68 deletions

View File

@@ -39,7 +39,6 @@ use crate::types::Element;
use crate::types::Keyword;
use crate::types::Paragraph;
use crate::types::QuoteBlock;
use crate::types::SetSource;
use crate::types::SpecialBlock;
#[cfg_attr(
@@ -257,9 +256,7 @@ fn greater_block_body<'c, 'b, 'g, 'r, 's>(
))))(remaining)?;
let leading_blank_lines =
leading_blank_lines.map(|(source, (first_line, _remaining_lines))| {
let mut element = Element::Paragraph(Paragraph::of_text(first_line.into()));
element.set_source(source.into());
element
Element::Paragraph(Paragraph::of_text(source.into(), first_line.into()))
});
let (remaining, (mut children, _exit_contents)) =
many_till(element_matcher, exit_matcher)(remaining)?;