File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ const _ = require('lodash');
3
3
const checkIfPathExists = require ( './checkIfPathExists' ) ;
4
4
5
5
module . exports = function getBadRelativeUrlsForFile ( mdFile ) {
6
- return _ . chain ( mdFile . links )
6
+ const badImages = _ . chain ( mdFile . links )
7
7
. filter ( link => link . endsWith ( '.png' ) || link . endsWith ( '.gif' ) )
8
8
. map ( ( link ) => {
9
9
// ignore external images
@@ -24,4 +24,16 @@ module.exports = function getBadRelativeUrlsForFile(mdFile) {
24
24
} )
25
25
. compact ( )
26
26
. value ( ) ;
27
+
28
+ const traillingSlashImages = _ . chain ( mdFile . links )
29
+ . filter ( link => link . endsWith ( '.png/' ) || link . endsWith ( '.gif/' ) )
30
+ . map ( link => ( {
31
+ fileToFix : mdFile . filepath ,
32
+ badImageLink : link ,
33
+ reason : 'extra trailing slash on image' ,
34
+ } ) )
35
+ . compact ( )
36
+ . value ( ) ;
37
+
38
+ return _ . concat ( badImages , traillingSlashImages ) ;
27
39
} ;
You can’t perform that action at this time.
0 commit comments