Merge pull request #685 from hackmdio/fixImageAlt

Fix image alt not render properly

Fixes #638
This commit is contained in:
Christoph (Sheogorath) Kern 2018-01-19 14:26:06 +01:00 committed by GitHub
commit d492070d3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1007,9 +1007,10 @@ md.use(markdownitContainer, 'info', { render: renderContainer })
md.use(markdownitContainer, 'warning', { render: renderContainer })
md.use(markdownitContainer, 'danger', { render: renderContainer })
let defaultImageRender = md.renderer.rules.image
md.renderer.rules.image = function (tokens, idx, options, env, self) {
tokens[idx].attrJoin('class', 'raw')
return self.renderToken(...arguments)
return defaultImageRender(...arguments)
}
md.renderer.rules.list_item_open = function (tokens, idx, options, env, self) {
tokens[idx].attrJoin('class', 'raw')