Expand href text and url typewriter text

This commit is contained in:
gloamxun committed 2026-10-24 22:42:17 +08:00
1 parent 8610a6c016
commit 874a327dca
5 files changed
+119 -5

No files matched your search

+26
View File
@@ -343,6 +343,32 @@ fn project_preview_expands_local_style_packages() {
assert!(!text.contains("ProvidesPackage"), "{text}");
}
#[test]
fn route_d_renders_href_and_url() {
let server = TestServer::start("route-d-links");
let source = "\\documentclass{article}\n\\begin{document}\nSee \\href{https://example.com}{Example} and \\url{https://x.test/a_b}.\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 ["E", "x", "a"] {
assert!(text.contains(&format!(">{character}</text>")), "{text}");
}
assert!(!text.contains("href"), "{text}");
assert!(!text.contains("url{"), "{text}");
}
#[test]
fn route_d_renders_verbatim_lines() {
let server = TestServer::start("route-d-verbatim");