Skip to content

Commit ed7a3d6

Browse files
committed
auto merge of #16556 : pczarn/rust/wbr, r=alexcrichton
Prevents zero-width spaces from appearing in copy-pasted paths. Fixes #16555
2 parents ef439dd + 958250c commit ed7a3d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustdoc/html/render.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,7 @@ impl<'a> fmt::Show for Item<'a> {
13161316
let cur = self.cx.current.as_slice();
13171317
let amt = if self.ismodule() { cur.len() - 1 } else { cur.len() };
13181318
for (i, component) in cur.iter().enumerate().take(amt) {
1319-
try!(write!(fmt, "<a href='{}index.html'>{}</a>&#8203;::",
1319+
try!(write!(fmt, "<a href='{}index.html'>{}</a>::<wbr>",
13201320
"../".repeat(cur.len() - i - 1),
13211321
component.as_slice()));
13221322
}
@@ -1325,7 +1325,7 @@ impl<'a> fmt::Show for Item<'a> {
13251325
shortty(self.item), self.item.name.get_ref().as_slice()));
13261326

13271327
// Write stability level
1328-
try!(write!(fmt, "&#8203;{}", Stability(&self.item.stability)));
1328+
try!(write!(fmt, "<wbr>{}", Stability(&self.item.stability)));
13291329

13301330
// Links to out-of-band information, i.e. src and stability dashboard
13311331
try!(write!(fmt, "</div><div class='out-of-band'>"));
@@ -2078,7 +2078,7 @@ impl<'a> fmt::Show for Sidebar<'a> {
20782078
let len = cx.current.len() - if it.is_mod() {1} else {0};
20792079
for (i, name) in cx.current.iter().take(len).enumerate() {
20802080
if i > 0 {
2081-
try!(write!(fmt, "&#8203;::"));
2081+
try!(write!(fmt, "::<wbr>"));
20822082
}
20832083
try!(write!(fmt, "<a href='{}index.html'>{}</a>",
20842084
cx.root_path

0 commit comments

Comments
 (0)