Merge pull request #796 from badboy/dont-trim-external-js-path

Don't strip relative path of additional javascript files
This commit is contained in:
Dylan DPC 2019-04-26 09:01:39 +02:00 committed by GitHub
commit 9712347b9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 7 deletions

View File

@ -425,13 +425,7 @@ fn make_data(
for script in &html.additional_js { for script in &html.additional_js {
match script.strip_prefix(root) { match script.strip_prefix(root) {
Ok(p) => js.push(p.to_str().expect("Could not convert to str")), Ok(p) => js.push(p.to_str().expect("Could not convert to str")),
Err(_) => js.push( Err(_) => js.push(script.to_str().expect("Could not convert to str")),
script
.file_name()
.expect("File has a file name")
.to_str()
.expect("Could not convert to str"),
),
} }
} }
data.insert("additional_js".to_owned(), json!(js)); data.insert("additional_js".to_owned(), json!(js));