@@ -138,22 +138,6 @@ fn check(cache: &mut Cache,
138
138
return None ;
139
139
}
140
140
141
- if file. ends_with ( "std/sys/ext/index.html" ) {
142
- return None ;
143
- }
144
-
145
- if let Some ( file) = file. to_str ( ) {
146
- // FIXME(#31948)
147
- if file. contains ( "ParseFloatError" ) {
148
- return None ;
149
- }
150
- // weird reexports, but this module is on its way out, so chalk it up to
151
- // "rustdoc weirdness" and move on from there
152
- if file. contains ( "scoped_tls" ) {
153
- return None ;
154
- }
155
- }
156
-
157
141
let mut parser = UrlParser :: new ( ) ;
158
142
parser. base_url ( base) ;
159
143
@@ -170,12 +154,24 @@ fn check(cache: &mut Cache,
170
154
171
155
// Search for anything that's the regex 'href[ ]*=[ ]*".*?"'
172
156
with_attrs_in_source ( & contents, " href" , |url, i| {
157
+ // Ignore external URLs
158
+ if url. starts_with ( "http:" ) || url. starts_with ( "https:" ) ||
159
+ url. starts_with ( "javascript:" ) || url. starts_with ( "ftp:" ) ||
160
+ url. starts_with ( "irc:" ) || url. starts_with ( "data:" ) {
161
+ return ;
162
+ }
173
163
// Once we've plucked out the URL, parse it using our base url and
174
- // then try to extract a file path. If either of these fail then we
175
- // just keep going.
164
+ // then try to extract a file path.
176
165
let ( parsed_url, path) = match url_to_file_path ( & parser, url) {
177
166
Some ( ( url, path) ) => ( url, PathBuf :: from ( path) ) ,
178
- None => return ,
167
+ None => {
168
+ * errors = true ;
169
+ println ! ( "{}:{}: invalid link - {}" ,
170
+ pretty_file. display( ) ,
171
+ i + 1 ,
172
+ url) ;
173
+ return ;
174
+ }
179
175
} ;
180
176
181
177
// Alright, if we've found a file name then this file had better
@@ -197,10 +193,11 @@ fn check(cache: &mut Cache,
197
193
Ok ( res) => res,
198
194
Err ( LoadError :: IOError ( err) ) => panic ! ( format!( "{}" , err) ) ,
199
195
Err ( LoadError :: BrokenRedirect ( target, _) ) => {
200
- print ! ( "{}:{}: broken redirect to {}" ,
201
- pretty_file. display( ) ,
202
- i + 1 ,
203
- target. display( ) ) ;
196
+ * errors = true ;
197
+ println ! ( "{}:{}: broken redirect to {}" ,
198
+ pretty_file. display( ) ,
199
+ i + 1 ,
200
+ target. display( ) ) ;
204
201
return ;
205
202
}
206
203
Err ( LoadError :: IsRedirect ) => unreachable ! ( ) ,
0 commit comments