Browse Source
Merge pull request #775 from hukkinj1/fix-image-newline
Fix newline not rendered in image alt attribute
pull/779/head
Vitaly Puzrin
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
11 additions and
0 deletions
-
lib/renderer.js
-
test/fixtures/markdown-it/commonmark_extras.txt
|
@ -300,6 +300,8 @@ Renderer.prototype.renderInlineAsText = function (tokens, options, env) { |
|
|
result += tokens[i].content; |
|
|
result += tokens[i].content; |
|
|
} else if (tokens[i].type === 'image') { |
|
|
} else if (tokens[i].type === 'image') { |
|
|
result += this.renderInlineAsText(tokens[i].children, options, env); |
|
|
result += this.renderInlineAsText(tokens[i].children, options, env); |
|
|
|
|
|
} else if (tokens[i].type === 'softbreak') { |
|
|
|
|
|
result += '\n'; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
@ -653,3 +653,12 @@ Issue #772. Header rule should not interfere with html tags. |
|
|
== |
|
|
== |
|
|
</pre> |
|
|
</pre> |
|
|
. |
|
|
. |
|
|
|
|
|
|
|
|
|
|
|
Newline in image description |
|
|
|
|
|
. |
|
|
|
|
|
There is a newline in this image  |
|
|
|
|
|
. |
|
|
|
|
|
<p>There is a newline in this image <img src="https://github.com/executablebooks/" alt="here |
|
|
|
|
|
it is"></p> |
|
|
|
|
|
. |
|
|