Create structure for line breaks.
This commit is contained in:
@@ -23,6 +23,7 @@ pub enum Object<'s> {
|
||||
CitationReference(CitationReference<'s>),
|
||||
InlineBabelCall(InlineBabelCall<'s>),
|
||||
InlineSourceBlock(InlineSourceBlock<'s>),
|
||||
LineBreak(LineBreak<'s>),
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
@@ -149,6 +150,11 @@ pub struct InlineSourceBlock<'s> {
|
||||
pub source: &'s str,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub struct LineBreak<'s> {
|
||||
pub source: &'s str,
|
||||
}
|
||||
|
||||
impl<'s> Source<'s> for Object<'s> {
|
||||
fn get_source(&'s self) -> &'s str {
|
||||
match self {
|
||||
@@ -173,6 +179,7 @@ impl<'s> Source<'s> for Object<'s> {
|
||||
Object::CitationReference(obj) => obj.source,
|
||||
Object::InlineBabelCall(obj) => obj.source,
|
||||
Object::InlineSourceBlock(obj) => obj.source,
|
||||
Object::LineBreak(obj) => obj.source,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -296,3 +303,9 @@ impl<'s> Source<'s> for InlineSourceBlock<'s> {
|
||||
self.source
|
||||
}
|
||||
}
|
||||
|
||||
impl<'s> Source<'s> for LineBreak<'s> {
|
||||
fn get_source(&'s self) -> &'s str {
|
||||
self.source
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user