diff --git a/lib/renderer.js b/lib/renderer.js index 5a173fe..ed3bd36 100644 --- a/lib/renderer.js +++ b/lib/renderer.js @@ -300,6 +300,8 @@ Renderer.prototype.renderInlineAsText = function (tokens, options, env) { result += tokens[i].content; } else if (tokens[i].type === 'image') { result += this.renderInlineAsText(tokens[i].children, options, env); + } else if (tokens[i].type === 'softbreak') { + result += '\n'; } } diff --git a/test/fixtures/markdown-it/commonmark_extras.txt b/test/fixtures/markdown-it/commonmark_extras.txt index f603271..6568d3d 100644 --- a/test/fixtures/markdown-it/commonmark_extras.txt +++ b/test/fixtures/markdown-it/commonmark_extras.txt @@ -653,3 +653,12 @@ Issue #772. Header rule should not interfere with html tags. == . + +Newline in image description +. +There is a newline in this image ![here +it is](https://github.com/executablebooks/) +. +

There is a newline in this image here
+it is

+.