Update tests

This commit is contained in:
Guillaume Gomez 2025-06-28 00:03:22 +02:00
parent 63e1dac122
commit f4c54178c8
2 changed files with 4 additions and 3 deletions

View file

@ -9,8 +9,9 @@ use std::path::{Path, PathBuf};
fn read_book_index(root: &Path) -> serde_json::Value {
let index = root.join("book/searchindex.js");
let index = std::fs::read_to_string(index).unwrap();
let index = index.trim_start_matches("window.search = JSON.parse('");
let index = index.trim_end_matches("');");
let index =
index.trim_start_matches("window.search = Object.assign(window.search, JSON.parse('");
let index = index.trim_end_matches("'));");
// We need unescape the string as it's supposed to be an escaped JS string.
serde_json::from_str(&index.replace("\\'", "'").replace("\\\\", "\\")).unwrap()
}

File diff suppressed because one or more lines are too long