about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2023-01-30 08:54:45 -0700
committerMichael Howell <michael@notriddle.com>2023-01-30 08:54:45 -0700
commit643d8e99668452669cc918defa555d372f57db5e (patch)
treed89e27b2843d0715a48c279ca88a35d273c93dab
parentfba9f33c7c9b6b439aabba2625102c818e1b24ed (diff)
downloadrust-643d8e99668452669cc918defa555d372f57db5e.tar.gz
rust-643d8e99668452669cc918defa555d372f57db5e.zip
rustdoc: do not include empty default-settings tag in HTML
-rw-r--r--src/librustdoc/html/templates/page.html2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/librustdoc/html/templates/page.html b/src/librustdoc/html/templates/page.html
index fddda293b9a..0b49234e9df 100644
--- a/src/librustdoc/html/templates/page.html
+++ b/src/librustdoc/html/templates/page.html
@@ -24,11 +24,13 @@
     {%- for theme in themes -%}
         <link rel="stylesheet" disabled href="{{page.root_path|safe}}{{theme}}{{page.resource_suffix}}.css"> {#- -#}
     {%- endfor -%}
+    {%- if !layout.default_settings.is_empty() -%}
     <script id="default-settings" {# -#}
       {% for (k, v) in layout.default_settings %}
         data-{{k}}="{{v}}"
       {%- endfor -%}
     ></script> {#- -#}
+    {%- endif -%}
     <script src="{{static_root_path|safe}}{{files.storage_js}}"></script> {#- -#}
     {%- if page.css_class.contains("crate") -%}
     <script defer src="{{page.root_path|safe}}crates{{page.resource_suffix}}.js"></script> {#- -#}