@@ -8,25 +8,26 @@ module.exports = function(file, line, callback) {
88
99 //create regular expression
1010 var regexs = [
11- new RegExp ( '\\!\\ [\\]\\((.*?)\\)' ) , //require alt tag for images
11+ new RegExp ( '\\[\\]\\((.*?)\\)' ) , //require alt tag for images
1212 new RegExp ( '^(# )\\w+' ) , // check for H1
1313 new RegExp ( '\\!\\[(.*\\.png.*)\\]\\(.*\\)' ) , // check for .png namings
1414 new RegExp ( '[^!]\\[.*?(here|there|file|folder|this|page)\\]\\((.*?)\\)' ) , // avoid useless url names
15- new RegExp ( '\\!\\ [(.{1,4 }|\\s{1,})\\]\\(.*\\)' ) , // conventions of alt-text for images are not observed (at least 5 characters, not only spaces)
15+ new RegExp ( '\\[(.{1,2 }|\\s{1,})\\]\\(.*\\)' ) , // conventions of alt-text for images are not observed (at least 3 characters, not only spaces)
1616 new RegExp ( '\\>###' ) , // avoid message box typo //(^\s*(\>){1,})\s*(\w){1,}
17- new RegExp ( '(.exe)(\\b)' ) // prohibit suspicious filetypes
18-
17+ new RegExp ( '(.exe)(\\b)' ) , // prohibit suspicious filetypes
18+ new RegExp ( '\\[.*\\]\\(\\)' ) //\[.*\]\(\)
1919 ]
2020
2121 //messages for regular expressions
2222 var msg = [
23- "alt-text tag for images is required " ,
23+ "empty alt-text tag for link/image " ,
2424 "no H1 (single #) allowed" ,
2525 "no filenames in alt-text for images allowed" ,
2626 "no useless hyperlinked terms" ,
27- "conventions of alt-text for images are not observed (at least 5 characters, not only spaces)" ,
27+ "conventions of alt-text for link/image are not observed (at least 3 characters, not only spaces)" ,
2828 "no message box typo" ,
29- "no suspicious file types in links"
29+ "no suspicious file types in links" ,
30+ "empty URL field"
3031 ]
3132
3233 //check line with every regex
0 commit comments