From 958250c0e5144c4fb07e80eb1742d810687bd80e Mon Sep 17 00:00:00 2001 From: Piotr Czarnecki Date: Sun, 17 Aug 2014 19:28:20 +0100 Subject: [PATCH] rustdoc: Fix and improve line break hints with the tag Prevents zero-width spaces from appearing in copy-pasted paths. Puts line breaks after `::`. Fixes #16555 --- src/librustdoc/html/render.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index bb68c6536a00..be62b1cc36f4 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1316,7 +1316,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { let cur = self.cx.current.as_slice(); let amt = if self.ismodule() { cur.len() - 1 } else { cur.len() }; for (i, component) in cur.iter().enumerate().take(amt) { - try!(write!(fmt, "{}​::", + try!(write!(fmt, "{}::", "../".repeat(cur.len() - i - 1), component.as_slice())); } @@ -1325,7 +1325,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { shortty(self.item), self.item.name.get_ref().as_slice())); // Write stability level - try!(write!(fmt, "​{}", Stability(&self.item.stability))); + try!(write!(fmt, "{}", Stability(&self.item.stability))); // Links to out-of-band information, i.e. src and stability dashboard try!(write!(fmt, "
")); @@ -2078,7 +2078,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { let len = cx.current.len() - if it.is_mod() {1} else {0}; for (i, name) in cx.current.iter().take(len).enumerate() { if i > 0 { - try!(write!(fmt, "​::")); + try!(write!(fmt, "::")); } try!(write!(fmt, "{}", cx.root_path