diff --git a/lib/renderer.js b/lib/renderer.js index ae3a155..0da9ad8 100644 --- a/lib/renderer.js +++ b/lib/renderer.js @@ -258,12 +258,11 @@ Renderer.prototype.renderInline = function (tokens, options, env) { * instead of simple escaping. **/ Renderer.prototype.renderInlineAsText = function (tokens, options, env) { - var result = '', - rules = this.rules; + var result = ''; for (var i = 0, len = tokens.length; i < len; i++) { if (tokens[i].type === 'text') { - result += rules.text(tokens, i, options, env, this); + result += tokens[i].content; } else if (tokens[i].type === 'image') { result += this.renderInlineAsText(tokens[i].children, options, env); } diff --git a/test/fixtures/markdown-it/commonmark_extras.txt b/test/fixtures/markdown-it/commonmark_extras.txt index a1e436a..040d156 100644 --- a/test/fixtures/markdown-it/commonmark_extras.txt +++ b/test/fixtures/markdown-it/commonmark_extras.txt @@ -1,3 +1,17 @@ +Issue #246. Double escaping in ALT +. +![&](#) +. +

&

+. + +Strip markdown in ALT tags +. +![*strip* [markdown __in__ alt](#)](#) +. +

strip markdown in alt

+. + Issue #55: . ![test]