Print imageReference with no alt in Markdown (#3643)

This commit is contained in:
Lucas Duailibe authored and GitHub committed 2018-01-03 13:54:53 -03:00
1 parent 7d3a30615b
commit 157df6e3fd
3 files changed
+9 -1

No files matched your search

+1 -1
View File
@@ -284,7 +284,7 @@ function genericPrint(path, options, print) {
case "imageReference":
switch (node.referenceType) {
case "full":
return concat(["![", node.alt, "][", node.identifier, "]"]);
return concat(["![", node.alt || "", "][", node.identifier, "]"]);
default:
return concat([
"![",
@@ -14,6 +14,13 @@ exports[`full.md 1`] = `
`;
exports[`full-no-alt.md 1`] = `
![][world]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
![][world]
`;
exports[`shortcut.md 1`] = `
![hello]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -0,0 +1 @@
![][world]