Fix handling affiliated keywords before invalid paragraphs.
This commit is contained in:
@@ -284,3 +284,21 @@ pub(crate) fn get_name<'s>(affiliated_keywords: &Vec<Keyword<'s>>) -> Option<&'s
|
||||
.last();
|
||||
name_keyword.map(|kw| kw.value)
|
||||
}
|
||||
|
||||
pub(crate) fn get_has_affiliated_keyword<'b, 'g, 'r, 's>(
|
||||
context: RefContext<'b, 'g, 'r, 's>,
|
||||
) -> Option<OrgSource<'s>> {
|
||||
for context in context.iter() {
|
||||
match context {
|
||||
ContextElement::HasAffiliatedKeyword(inner) => {
|
||||
if !inner.keywords.is_empty() {
|
||||
return Some(inner.start_after_affiliated_keywords);
|
||||
} else {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user