Browse Source

Fix newline not rendered in image alt attribute

pull/775/head
Taneli Hukkinen 3 years ago
parent
commit
272a470ed2
  1. 2
      lib/renderer.js
  2. 9
      test/fixtures/markdown-it/commonmark_extras.txt

2
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';
}
}

9
test/fixtures/markdown-it/commonmark_extras.txt

@ -653,3 +653,12 @@ Issue #772. Header rule should not interfere with html tags.
==
</pre>
.
Newline in image description
.
There is a newline in this image ![here
it is](https://github.com/executablebooks/)
.
<p>There is a newline in this image <img src="https://github.com/executablebooks/" alt="here
it is"></p>
.

Loading…
Cancel
Save