From 6149cf982c6c275d73345bc3d476ded733e7bc2f Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 29 Jul 2022 14:32:48 +0200 Subject: [PATCH] Remove unwanted extra white space characters from HTML --- src/librustdoc/html/render/print_item.rs | 22 ++++++++++--------- src/librustdoc/html/templates/page.html | 14 ++++++------ src/librustdoc/html/templates/print_item.html | 4 ++-- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index 69d66693f752e..547d6696a431d 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -311,7 +311,7 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items: w, "

\ {name}\ -

\n{}", + {}", ITEM_TABLE_OPEN, id = cx.derive_id(my_section.id().to_owned()), name = my_section.name(), @@ -415,10 +415,10 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items: write!( w, "
\ - {name}\ - {visibility_emoji}\ - {unsafety_flag}\ - {stab_tags}\ + {name}\ + {visibility_emoji}\ + {unsafety_flag}\ + {stab_tags}\
\
{docs}
", name = myitem.name.unwrap(), @@ -1126,7 +1126,8 @@ fn item_union(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean: write!( w, "

\ - Fields

" + Fields\ + " ); for (field, ty) in fields { let name = field.name.expect("union field name"); @@ -1238,7 +1239,8 @@ fn item_enum(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, e: &clean:: write!( w, "

\ - Variants{}

", + Variants{}\ + ", document_non_exhaustive_header(it) ); document_non_exhaustive(w, it); @@ -1294,9 +1296,9 @@ fn item_enum(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, e: &clean:: w, "
\ \ - \ - {f}: {t}\ - ", + \ + {f}: {t}\ + ", id = id, f = field.name.unwrap(), t = ty.print(cx) diff --git a/src/librustdoc/html/templates/page.html b/src/librustdoc/html/templates/page.html index 9a551b68279d6..8e25f6764a9c5 100644 --- a/src/librustdoc/html/templates/page.html +++ b/src/librustdoc/html/templates/page.html @@ -82,10 +82,10 @@ {%- else -%} {#- -#} {%- endif -%} -
+ {#- -#} {#- -#} -

- +

{#- -#} + {#- -#} {#- -#} @@ -122,12 +122,12 @@

{#- -#} {#- -#}
{#- -#} -
+
{#- -#} {#- -#} Change settings {#- -#} {#- -#} -
+
{#- -#} {#- -#} {#- -#} {#- -#} @@ -143,6 +143,6 @@

data-resource-suffix="{{page.resource_suffix}}" {# -#} data-rustdoc-version="{{rustdoc_version}}" {# -#} > {#- -#} - + {#- -#} {#- -#} {#- -#} diff --git a/src/librustdoc/html/templates/print_item.html b/src/librustdoc/html/templates/print_item.html index 62b1b7ca7292a..c755157d27687 100644 --- a/src/librustdoc/html/templates/print_item.html +++ b/src/librustdoc/html/templates/print_item.html @@ -1,4 +1,4 @@ -
+
{#- -#}

{#- -#} {#- -#} {{-typ-}} @@ -27,4 +27,4 @@

{#- -#} [] {#- -#} {#- -#} {#- -#} -

+
{#- -#}