comparing begin and end offsets for top-level sections and headlines.

This commit is contained in:
Tom Alexander
2023-04-11 19:16:04 -04:00
parent 276e8abb13
commit 52b401d548
6 changed files with 109 additions and 6 deletions

View File

@@ -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> {