markdown-it-linkify-images
Advanced tools
Comparing version
@@ -10,2 +10,3 @@ 'use strict' | ||
var url = token.attrs[srcIndex][1] | ||
var title = '' | ||
var caption = token.content | ||
@@ -17,5 +18,9 @@ | ||
if (token.attrIndex('title') !== -1) { | ||
title = ' title="' + token.attrs[token.attrIndex('title')][1] + '"' | ||
} | ||
return '' + | ||
'<a href="' + url + '"' + linkClass + target + '>' + | ||
'<img src="' + url + '" alt="' + caption + '"' + imgClass + '>' + | ||
'<img src="' + url + '" alt="' + caption + '"' + imgClass + title + '>' + | ||
'</a>' | ||
@@ -22,0 +27,0 @@ } |
{ | ||
"name": "markdown-it-linkify-images", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "A markdown-it plugin to add links to images", | ||
@@ -29,11 +29,10 @@ "main": "index.js", | ||
"devDependencies": { | ||
"browserify": "^13.0.0", | ||
"chai": "^3.5.0", | ||
"chalk": "^1.1.3", | ||
"markdown-it": "^6.0.1", | ||
"mocha": "^2.4.5", | ||
"browserify": "^14.1.0", | ||
"chai": "^4.1.1", | ||
"chalk": "^2.1.0", | ||
"mocha": "^4.1.0", | ||
"rimraf": "^2.5.2", | ||
"snazzy": "^3.0.1", | ||
"standard": "^6.0.8", | ||
"uglify-js": "^2.6.2" | ||
"snazzy": "^7.0.0", | ||
"standard": "^10.0.3", | ||
"uglify-js": "^3.3.4" | ||
}, | ||
@@ -40,0 +39,0 @@ "standard": { |
# markdown-it-linkify-images | ||
[](https://greenkeeper.io/) | ||
A markdown-it plugin to add links to images | ||
@@ -44,5 +46,8 @@ | ||
## Testing | ||
This plugin is tested against markdown-it @ 6,7,8 and latest | ||
## License | ||
[MIT](https://github.com/markdown-it/markdown-it-footnote/blob/master/LICENSE) |
5187
10.53%8
-11.11%6
20%30
15.38%53
10.42%