Print imageReference with no alt in Markdown (#3643)

master
Lucas Duailibe 2018-01-03 13:54:53 -03:00 committed by GitHub
parent 7d3a30615b
commit 157df6e3fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

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([
"![",

View File

@ -14,6 +14,13 @@ exports[`full.md 1`] = `
`;
exports[`full-no-alt.md 1`] = `
![][world]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
![][world]
`;
exports[`shortcut.md 1`] = `
![hello]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -0,0 +1 @@
![][world]