lint links

This commit is contained in:
Leo Horie 2017-01-08 21:29:26 -05:00
parent e4d69c409a
commit d397e66e03
5 changed files with 26 additions and 6 deletions

View file

@ -37,7 +37,9 @@ function generate(pathname) {
var modified = guides.match(link) ? guides.replace(link, replace) : methods.replace(link, replace)
return title + modified + "\n\n"
})
.replace(/\.md/gim, ".html") // fix links
.replace(/(\[[^\]]+)(\.md)/gim, function(match, path, extension) {
return path + (path.match(/http/) ? extension : ".html")
}) // fix links
var html = layout
.replace(/\[version\]/, version) // update version
.replace(/\[body\]/, marked(fixed))