fix: caching inaccuracy

This commit is contained in:
Mark
2026-03-25 13:53:59 +01:00
parent deac3524a3
commit c66fd6b7cd

View File

@@ -278,7 +278,9 @@ fn doc_to_impl<'a>(
out.push_str(&format!("</span>{a}</div>\n")); out.push_str(&format!("</span>{a}</div>\n"));
} }
for section in &doc.sections { for section in &doc.sections {
if let Some(prev) = doc_args.state.cache.get(section) { if doc_args.max_len.is_none()
&& let Some(prev) = doc_args.state.cache.get(section)
{
out.push_str(prev); out.push_str(prev);
continue; continue;
} }
@@ -376,10 +378,12 @@ fn doc_to_impl<'a>(
} }
} }
out.push_str("</div>\n"); out.push_str("</div>\n");
doc_args if doc_args.max_len.is_none() {
.state doc_args
.cache .state
.insert(section, out[section_start..].to_owned()); .cache
.insert(section, out[section_start..].to_owned());
}
} }
for _ in depth..=doc.depth { for _ in depth..=doc.depth {
out.push_str("</div>\n"); out.push_str("</div>\n");