|
|
@ -12,6 +12,7 @@ var isSpace = require('../common/utils').isSpace; |
|
|
|
module.exports = function image(state, silent) { |
|
|
|
var attrs, |
|
|
|
code, |
|
|
|
content, |
|
|
|
label, |
|
|
|
labelEnd, |
|
|
|
labelStart, |
|
|
@ -136,8 +137,10 @@ module.exports = function image(state, silent) { |
|
|
|
// so all that's left to do is to call tokenizer.
|
|
|
|
//
|
|
|
|
if (!silent) { |
|
|
|
content = state.src.slice(labelStart, labelEnd); |
|
|
|
|
|
|
|
state.md.inline.parse( |
|
|
|
state.src.slice(labelStart, labelEnd), |
|
|
|
content, |
|
|
|
state.md, |
|
|
|
state.env, |
|
|
|
tokens = [] |
|
|
@ -146,6 +149,8 @@ module.exports = function image(state, silent) { |
|
|
|
token = state.push('image', 'img', 0); |
|
|
|
token.attrs = attrs = [ [ 'src', href ], [ 'alt', '' ] ]; |
|
|
|
token.children = tokens; |
|
|
|
token.content = content; |
|
|
|
|
|
|
|
if (title) { |
|
|
|
attrs.push([ 'title', title ]); |
|
|
|
} |
|
|
|