Preserve verbatim environments as monospaced lines

This commit is contained in:
gloamxun committed 2026-10-24 22:39:43 +08:00
1 parent 8955babea8
commit 8610a6c016
5 files changed
+82 -4

No files matched your search

+25
View File
@@ -343,6 +343,31 @@ fn project_preview_expands_local_style_packages() {
assert!(!text.contains("ProvidesPackage"), "{text}");
}
#[test]
fn route_d_renders_verbatim_lines() {
let server = TestServer::start("route-d-verbatim");
let source = "\\documentclass{article}\n\\begin{document}\n\\begin{verbatim}\nQRS code\nXYZ code\n\\end{verbatim}\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();
for character in ["Q", "R", "S", "X", "Y", "Z"] {
assert!(text.contains(&format!(">{character}</text>")), "{text}");
}
assert!(!text.contains("verbatim"), "{text}");
}
#[test]
fn route_d_renders_float_lists() {
let server = TestServer::start("route-d-float-lists");