Radio targets are now being properly detected and they trigger re-parses but the tests do not yet pass.
This commit is contained in:
@@ -18,6 +18,7 @@ use super::element::Element;
|
||||
use super::object::Object;
|
||||
use super::parser_with_context::parser_with_context;
|
||||
use super::source::Source;
|
||||
use super::token::AllTokensIterator;
|
||||
use super::token::Token;
|
||||
use super::util::exit_matcher_parser;
|
||||
use super::util::get_consumed;
|
||||
@@ -286,27 +287,6 @@ fn headline_end<'r, 's>(_context: Context<'r, 's>, input: &'s str) -> Res<&'s st
|
||||
|
||||
impl<'s> Document<'s> {
|
||||
pub fn iter_tokens<'r>(&'r self) -> impl Iterator<Item = Token<'r, 's>> {
|
||||
self.zeroth_section
|
||||
.iter()
|
||||
.map(Token::Section)
|
||||
.chain(self.children.iter().map(Token::Heading))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'s> Heading<'s> {
|
||||
pub fn iter_tokens<'r>(&'r self) -> impl Iterator<Item = Token<'r, 's>> {
|
||||
self.title
|
||||
.iter()
|
||||
.map(Token::Object)
|
||||
.chain(self.children.iter().map(|de| match de {
|
||||
DocumentElement::Heading(obj) => Token::Heading(obj),
|
||||
DocumentElement::Section(obj) => Token::Section(obj),
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'s> Section<'s> {
|
||||
pub fn iter_tokens<'r>(&'r self) -> impl Iterator<Item = Token<'r, 's>> {
|
||||
self.children.iter().map(Token::Element)
|
||||
AllTokensIterator::new(Token::Document(self))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user