Skip to content

Commit 4a20fb4

Browse files
QuietMisdreavusManishearth
authored andcommitted
use @ instead of space for link ambiguity markers
since spaces aren't allowed in link targets in commonmark, a new symbol is needed to separate the marker from the rest of the path. hence, @
1 parent a3d71d7 commit 4a20fb4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/librustdoc/clean/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -848,21 +848,21 @@ impl Clean<Attributes> for [ast::Attribute] {
848848
"trait", "union"].iter()
849849
.find(|p| link.starts_with(**p)) {
850850
kind = PathKind::Type;
851-
link.trim_left_matches(prefix).trim()
851+
link.trim_left_matches(prefix).trim_left_matches('@')
852852
} else if let Some(prefix) =
853853
["const", "static"].iter()
854854
.find(|p| link.starts_with(**p)) {
855855
kind = PathKind::Value;
856-
link.trim_left_matches(prefix).trim()
856+
link.trim_left_matches(prefix).trim_left_matches('@')
857857
} else if link.ends_with("()") {
858858
kind = PathKind::Value;
859-
link.trim_right_matches("()").trim()
859+
link.trim_right_matches("()")
860860
} else if link.ends_with('!') {
861861
kind = PathKind::Macro;
862-
link.trim_right_matches('!').trim()
862+
link.trim_right_matches('!')
863863
} else {
864-
link.trim()
865-
};
864+
&link[..]
865+
}.trim();
866866

867867
// avoid resolving things (i.e. regular links) which aren't like paths
868868
// FIXME(Manishearth) given that most links have slashes in them might be worth

0 commit comments

Comments
 (0)