Implement the horizontal rule parser.

This commit is contained in:
Tom Alexander
2023-04-21 22:23:59 -04:00
parent 3fb0de97cf
commit bfffde3fdb
7 changed files with 77 additions and 0 deletions

View File

@@ -79,6 +79,11 @@ pub struct FixedWidthArea<'s> {
pub source: &'s str,
}
#[derive(Debug)]
pub struct HorizontalRule<'s> {
pub source: &'s str,
}
impl<'s> Paragraph<'s> {
pub fn of_text(input: &'s str) -> Self {
let mut objects = Vec::with_capacity(1);
@@ -157,3 +162,9 @@ impl<'s> Source<'s> for FixedWidthArea<'s> {
self.source
}
}
impl<'s> Source<'s> for HorizontalRule<'s> {
fn get_source(&'s self) -> &'s str {
self.source
}
}