Fix handling affiliated keywords before invalid paragraphs.

This commit is contained in:
Tom Alexander
2023-10-04 23:40:38 -04:00
parent 65eda08843
commit 1351577c5a
5 changed files with 62 additions and 10 deletions

View File

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