Skip to content

Commit cd324ec

Browse files
committed
Remove extra whitespace from rustdoc breadcrumbs for copypasting
1 parent 814ebca commit cd324ec

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

src/librustdoc/html/static/css/rustdoc.css

+3-6
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,12 @@ h1, h2, h3, h4 {
192192
.rustdoc-breadcrumbs {
193193
grid-area: main-heading-breadcrumbs;
194194
line-height: 1.25;
195-
display: flex;
196-
flex-wrap: wrap;
197-
align-items: end;
198195
padding-top: 5px;
196+
position: relative;
197+
z-index: 1;
199198
}
200199
.rustdoc-breadcrumbs a {
201-
padding: 4px 0;
202-
margin: -4px 0;
203-
z-index: 1;
200+
padding: 5px 0 7px;
204201
}
205202
/* The only headings that get underlines are:
206203
Markdown-generated headings within the top-doc

src/librustdoc/html/templates/print_item.html

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<div class="main-heading">
2-
{% if !path_components.is_empty() %}
3-
<span class="rustdoc-breadcrumbs">
4-
{% for (i, component) in path_components.iter().enumerate() %}
5-
{% if i != 0 %}
2+
{% if !path_components.is_empty() -%}
3+
<div class="rustdoc-breadcrumbs">
4+
{%- for (i, component) in path_components.iter().enumerate() -%}
5+
{%- if i != 0 -%}
66
::<wbr>
7-
{% endif %}
7+
{%- endif -%}
88
<a href="{{component.path|safe}}index.html">{{component.name}}</a>
9-
{% endfor %}
10-
</span>
11-
{% endif %}
9+
{%- endfor -%}
10+
</div>
11+
{%- endif -%}
1212
<h1>
1313
{{typ}}
1414
<span{% if item_type != "mod" +%} class="{{item_type}}"{% endif %}>
15-
{{name}}
15+
{{- name -}}
1616
</span> {# #}
1717
<button id="copy-path" title="Copy item path to clipboard"> {# #}
1818
Copy item path {# #}

0 commit comments

Comments
 (0)