File tree 1 file changed +11
-8
lines changed
lib/plugins/validators/sync
1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -29,15 +29,18 @@ export default {
29
29
const isProtocolless = / ^ \/ \/ / . test ( link . href ) ;
30
30
31
31
const href = urlLib . resolve ( url , link . href ) ;
32
- if ( link . href !== href
33
- // Spaces in direct image srcs are replaced with "%20"
34
- // in `urlLib.resolve(url, link.href)`
35
- && decodeURIComponent ( link . href ) !== decodeURIComponent ( href )
36
- ) {
37
- link . href = href ;
32
+ try {
33
+ if ( link . href !== href
34
+ // Spaces in direct image srcs are replaced with "%20"
35
+ // in `urlLib.resolve(url, link.href)`
36
+ && decodeURIComponent ( link . href ) !== decodeURIComponent ( href )
37
+ ) {
38
+ link . href = href ;
39
+ }
40
+ } catch ( ex ) {
41
+ // URI malformed.
38
42
}
39
43
40
-
41
44
const domainRE = / ^ (?: h t t p s ? : ) ? \/ \/ ( [ ^ \/ ] + ) \/ / ;
42
45
var urlDomainMatch , linkDomainMatch ;
43
46
// But undo protocol resolution when it forces HTTP or domains do not match.
@@ -93,4 +96,4 @@ export default {
93
96
// Defined && unique values.
94
97
link . rel = [ ...new Set ( link . rel ) ] ;
95
98
}
96
- } ;
99
+ } ;
You can’t perform that action at this time.
0 commit comments