File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ const _ = require('lodash');
33const checkIfPathExists = require ( './checkIfPathExists' ) ;
44
55module . exports = function getBadRelativeUrlsForFile ( mdFile ) {
6- return _ . chain ( mdFile . links )
6+ const badImages = _ . chain ( mdFile . links )
77 . filter ( link => link . endsWith ( '.png' ) || link . endsWith ( '.gif' ) )
88 . map ( ( link ) => {
99 // ignore external images
@@ -24,4 +24,16 @@ module.exports = function getBadRelativeUrlsForFile(mdFile) {
2424 } )
2525 . compact ( )
2626 . 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 ) ;
2739} ;
You can’t perform that action at this time.
0 commit comments