aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/writers/markdown-writer.js4
-rw-r--r--tests/writers/markdown-writer.tests.js6
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/writers/markdown-writer.js b/lib/writers/markdown-writer.js
index 5a75db7..711f722 100644
--- a/lib/writers/markdown-writer.js
+++ b/lib/writers/markdown-writer.js
@@ -41,7 +41,7 @@ function markdownImage() {
this.open = function(attributes) {
var src = attributes.src || "";
var altText = attributes.alt || "";
- return "[" + altText + "](" + src + ")";
+ return "![" + altText + "](" + src + ")";
};
this.close = function() {
@@ -52,7 +52,7 @@ function markdownImage() {
// don't display empty content (this is mainly to remove images with no src data)
var content = this.open(attrs) + this.close();
- if (content === "[]()") {
+ if (content === "![]()") {
return "";
}
diff --git a/tests/writers/markdown-writer.tests.js b/tests/writers/markdown-writer.tests.js
index b295d45..7ed5681 100644
--- a/tests/writers/markdown-writer.tests.js
+++ b/tests/writers/markdown-writer.tests.js
@@ -112,19 +112,19 @@ describe('markdown-writer', function() {
test('can generate images', function() {
var writer = mdWriter.writer();
writer.selfClosing("img", { "src": "http://example.com/image.jpg", "alt": "Alt Text" });
- return assert.equal(writer.asString(), "[Alt Text](http://example.com/image.jpg)");
+ return assert.equal(writer.asString(), "![Alt Text](http://example.com/image.jpg)");
});
test('can generate images with missing alt attribute', function() {
var writer = mdWriter.writer();
writer.selfClosing("img", { "src": "http://example.com/image.jpg" });
- return assert.equal(writer.asString(), "[](http://example.com/image.jpg)");
+ return assert.equal(writer.asString(), "![](http://example.com/image.jpg)");
});
test('can generate images with misssing src attribute', function() {
var writer = mdWriter.writer();
writer.selfClosing("img", { "alt": "Alt Text" });
- return assert.equal(writer.asString(), "[Alt Text]()");
+ return assert.equal(writer.asString(), "![Alt Text]()");
});
test("doesn't display empty images", function() {