Skip to content

Commit 071a15b

Browse files
Replace document.write with document.head.innerHTML
1 parent 5974fe8 commit 071a15b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustdoc/html/templates/page.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<title>{{page.title}}</title> {# #}
99
<script>if(window.location.protocol!=="file:") {# Hack to skip preloading fonts locally - see #98769 #}
1010
for(f of "{{files.source_serif_4_regular}},{{files.fira_sans_regular}},{{files.fira_sans_medium}},{{files.source_code_pro_regular}},{{files.source_code_pro_semibold}}".split(",")) {# #}
11-
document.write(`<link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}${f}">`) {# #}
11+
document.head.innerHTML += `<link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}${f}">` {# #}
1212
</script> {# #}
1313
<link rel="stylesheet" {#+ #}
1414
href="{{static_root_path|safe}}{{files.normalize_css}}"> {# #}

0 commit comments

Comments
 (0)