We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ed1cbe commit 7acc7a0Copy full SHA for 7acc7a0
tests/rendered_output.rs
@@ -773,9 +773,10 @@ mod search {
773
fn read_book_index(root: &Path) -> serde_json::Value {
774
let index = root.join("book/searchindex.js");
775
let index = fs::read_to_string(index).unwrap();
776
- let index = index.trim_start_matches("Object.assign(window.search, ");
777
- let index = index.trim_end_matches(");");
778
- serde_json::from_str(index).unwrap()
+ let index = index.trim_start_matches("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.
779
+ serde_json::from_str(&index.replace("\\'", "'").replace("\\\\", "\\")).unwrap()
780
}
781
782
#[test]
0 commit comments