Expand tableofcontents into numbered heading lines

This commit is contained in:
gloamxun committed 2026-10-24 22:35:19 +08:00
1 parent f48b10340a
commit b2f5b67b07
5 files changed
+125 -4

No files matched your search

+23
View File
@@ -343,6 +343,29 @@ fn project_preview_expands_local_style_packages() {
assert!(!text.contains("ProvidesPackage"), "{text}");
}
#[test]
fn route_d_renders_a_table_of_contents() {
let server = TestServer::start("route-d-toc");
let source = "\\documentclass{article}\n\\begin{document}\n\\tableofcontents\n\n\\section{Intro}\n\nBody.\n\\end{document}";
let put = server.request(
"PUT",
"/api/projects/hello/file?path=hello.tex",
source.as_bytes(),
"text/plain; charset=utf-8",
);
assert_eq!(put.status, 200, "{}", put.text());
let preview = server.request(
"POST",
"/api/projects/hello/preview?engine=route-d",
&[],
"application/json",
);
assert_eq!(preview.status, 200, "{}", preview.text());
let text = preview.text();
assert_eq!(text.matches(">I</text>").count(), 2, "{text}");
assert!(!text.contains("texrratoc"), "{text}");
}
#[test]
fn project_preview_expands_required_style_packages() {
let server = TestServer::start("route-d-required-package");