Expand href text and url typewriter text
This commit is contained in:
1 parent
8610a6c016
commit
874a327dca
5 files changed
+119
-5
No files matched your search
@@ -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");
|
||||
|
||||
Reference in new issue
Block a user