comparing begin and end offsets for top-level sections and headlines.
This commit is contained in:
@@ -74,6 +74,18 @@ impl<'s> Source<'s> for DocumentElement<'s> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'s> Source<'s> for Section<'s> {
|
||||
fn get_source(&'s self) -> &'s str {
|
||||
self.source
|
||||
}
|
||||
}
|
||||
|
||||
impl<'s> Source<'s> for Heading<'s> {
|
||||
fn get_source(&'s self) -> &'s str {
|
||||
self.source
|
||||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(ret, level = "debug")]
|
||||
#[allow(dead_code)]
|
||||
pub fn document(input: &str) -> Res<&str, Document> {
|
||||
|
||||
@@ -17,4 +17,6 @@ mod util;
|
||||
pub use document::document;
|
||||
pub use document::Document;
|
||||
pub use document::Section;
|
||||
pub use document::Heading;
|
||||
pub use source::Source;
|
||||
type Context<'r, 's> = &'r parser_context::ContextTree<'r, 's>;
|
||||
|
||||
Reference in New Issue
Block a user